Updated README.md with curl command and tesseract dependency
This commit is contained in:
parent
3f3cc276f2
commit
6c1ece44ab
40
README.md
40
README.md
|
@ -20,6 +20,15 @@ AnkiAI is a tool that leverages OCR (Optical Character Recognition) and GPT-3's
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
|
#### System Dependencies
|
||||||
|
|
||||||
|
You need Tesseract for the OCR functionality:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt-get install tesseract-ocr
|
||||||
|
```
|
||||||
|
#### Python Dependencies
|
||||||
|
|
||||||
To run AnkiAI, you'll need to have the following dependencies installed:
|
To run AnkiAI, you'll need to have the following dependencies installed:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -29,7 +38,7 @@ openai
|
||||||
flask
|
flask
|
||||||
```
|
```
|
||||||
|
|
||||||
You can install these via `pip` using the `requirements.txt` file:
|
You can install the Python dependencies via `pip` using the `requirements.txt` file:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
@ -38,7 +47,11 @@ pip install -r requirements.txt
|
||||||
### How to Run
|
### How to Run
|
||||||
|
|
||||||
1. **Environment Variables**: Make sure to set the `OPENAI_API_KEY` environment variable to your OpenAI API key.
|
1. **Environment Variables**: Make sure to set the `OPENAI_API_KEY` environment variable to your OpenAI API key.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export OPENAI_API_KEY=sk-myapikey
|
||||||
|
```
|
||||||
|
|
||||||
2. **Run the Flask server**:
|
2. **Run the Flask server**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -55,6 +68,29 @@ pip install -r requirements.txt
|
||||||
python ankiai.py <directory_path_containing_images>
|
python ankiai.py <directory_path_containing_images>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Example curl commands to interact with the service:
|
||||||
|
|
||||||
|
You can make POST requests to the server using curl. Here are some examples from the command line history:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST -o deck.apkg \
|
||||||
|
-F "image=@/home/ubuntu/Pictures/image1.png" \
|
||||||
|
-F "image=@/home/ubuntu/Pictures/image2.png" \
|
||||||
|
-F "image=@/home/ubuntu/Pictures/image3.png" \
|
||||||
|
http://localhost:5000/deck-from-images
|
||||||
|
```
|
||||||
|
|
||||||
|
Batch processing of images:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
for file in /home/ubuntu/Pictures/*; do
|
||||||
|
if [[ -f "$file" ]]; then
|
||||||
|
basefile=$(basename "$file");
|
||||||
|
curl -X POST -o "deck-${basefile}.apkg" -F "image=@${file}" http://localhost:5000/deck-from-images;
|
||||||
|
fi;
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
### How to Debug (VSCode Users)
|
### How to Debug (VSCode Users)
|
||||||
|
|
||||||
- Open the project in VSCode.
|
- Open the project in VSCode.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user