Backend files for TRAIT Senior Project.
TRAIT Backend is a Python-based server application that provides API endpoints and backend functionality for the TRAIT project. This is part of a senior project implementation.
- Python 3.x
- pip (Python package manager)
- Clone the repository:
git clone https://github.com/logan-taggart/TRAIT-Back.git
cd TRAIT-Back
- Install dependencies:
pip install -r requirements.txt
- For macOS users: If you encounter security issues with the package, run:
xattr -rd com.apple.quarantine TRAIT-Back
Start the backend server using:
python3 run.py
The server will start on port 5174.
Image Endpoints:
GET /image/
- Image health check endpointPOST /image/detect-all
- Detect all logos in an image endpointPOST /image/detect-specific
- Detect specific logos in an image endpointPOST /image/cancel
- Cancel image processing endpoint
Video Endpoints:
GET /video/
- Video health check endpointGET /video/fetch-progress
- Status of current video processing endpointGET /video/fetch-processed-video
- Retrieve proccesed video endpointPOST /video/detect-all
- Detect all logos in a video endpointPOST /video/detect-specific
- Detect specific logos in a video endpointPOST /video/cancel
- Cancel video processing endpoint
- Server runs on
localhost:5174
by default
TRAIT-Back/
├── run.py
├── app.py
├── models/
| ├── logo_detection.pt
| └── model_load.py
├── routes/
│ ├── image_routes.py
│ └── video_routes.py
├── utils/
│ ├── cancel_process.py
│ ├── video_progress.py
│ ├── embed.py
│ ├── logo_detection_utils.py
│ ├── process_image.py
│ └── process_video.py
├── .gitignore
├── .dockerignore
├── Dockerfile
├── requirements.txt
└── README.md
Port already in use:
- Check if another application is using port 5174
- Kill the process or change the port in the configuration
Permission errors on macOS:
- Run the
xattr
command mentioned in the installation section
Module not found errors:
- Ensure all dependencies are installed:
pip install -r requirements.txt
- Check your Python version compatibility
- Python 3.x - Main programming language
- Flask, Ultralytics, Numpy, Transformers, FAISS, CV2... - Main Python libraries
- YOLOv8 - Computer Vision Model
- Author: Logan Taggart, Caleb Stewart, Lane Keck
- Link to Backend Repository: TRAIT-Back
- Link to Frontend Repository: TRAIT-Front
Last updated: June 1st, 2025