A flask-based backend for FertiScan.
- Python 3.8 or higher
- pip
- virtualenv
- Azure Document Intelligence and OpenAI API keys
cd fertiscan-backend
pip install -r requirements.txt
python ./app.py
-
Build the docker image
docker build -t fertiscan-backend \ --build-arg ARG_AZURE_API_ENDPOINT=your_actual_azure_form_recognizer_endpoint \ --build-arg ARG_AZURE_API_KEY=your_actual_azure_form_recognizer_key \ --build-arg ARG_AZURE_OPENAI_API_ENDPOINT=your_actual_azure_openai_endpoint \ --build-arg ARG_AZURE_OPENAI_API_KEY=your_actual_azure_openai_key \ --build-arg ARG_PROMPT_PATH=actual_path/to/prompt_file \ --build-arg ARG_UPLOAD_PATH=actual_path/to/upload_file \ --build-arg ARG_FRONTEND_URL=http://url.to_frontend/ \ .
-
Run the docker image
docker run -p 5000:5000 fertiscan-backend
-
Test the application
Go to http://localhost:5000
and test the application.
Coming soon...
Create a .env
file in the root directory from .env.template
:
AZURE_API_ENDPOINT=your_azure_form_recognizer_endpoint
AZURE_API_KEY=your_azure_form_recognizer_key
AZURE_OPENAI_API_ENDPOINT=your_azure_openai_endpoint
AZURE_OPENAI_API_KEY=your_azure_openai_key
PROMPT_PATH=path/to/file
UPLOAD_PATH=path/to/file
FRONTEND_URL=http://url.to_frontend/
POST /analyze
: Analyze the images and returns the form.