This file uses the CLIP service to determine if an animal image is dangerous or not.
This file is the backend companion of https://github.com/Encode-Group16-AI-bootcamp-Q3-2024/computer-vision-weekend-project
- Python 3.8 or higher
- pip (Python package installer)
- virtualenv (recommended for creating isolated Python environments)
Follow these steps to set up the project environment and install the necessary packages:
-
Clone the repository:
git clone [email protected]:Encode-Group16-AI-bootcamp-Q3-2024/computer-vision-clipserver.git cd computer-vision-clipserver
-
Create a virtual environment:
python -m venv myenv
-
Activate the virtual environment:
- On Windows:
myenv\Scripts\activate
- On macOS and Linux:
source myenv/bin/activate
- On Windows:
-
Install the required packages:
pip install torch torchvision clip flask pillow
Run the server before run the Next JS Project.
python analyze-animal.py
The server will expose the following URL: http://localhost:5000/analyze Use it in the project env CLIP_API_URL
CLIP_API_URL=http://localhost:5000/analyze