gRPC server for Object Detection service. This is a personal project of Python implementation of a gRPC service with support for object detection from image and video / camera stream. For object detection, Ultralytics YOLO 🚀 is utilized, by default pretrained YOLOv8 (coco dataset) model is used. Custom trained model can also be used.
Use Python version 3.10
Make sure to have anaconda or miniconda installed
conda create -n grpcenv python=3.10
conda activate grpcenv
cd grpc-ml-server
pip install -r requirements.txt
cd grpc-ml-server
pip3 install virtualenv
(if virtualenv is not installed)python3 -m virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
- Follow the CUDA Installation Guide (Install cuda-11.7)
-
pip install torch==1.13.0+cu{CUDA VERSION} torchvision==0.14.0+cu{CUDA VERSION} --extra-index-url https://download.pytorch.org/whl/cu{CUDA VERSION}
-
pip install torch==1.13.0+cpu torchvision==0.14.0+cpu --extra-index-url https://download.pytorch.org/whl/cpu
When adding a new service, proto file should be compiled with the following command:
bash compile_proto.sh <SERVICE_NAME>
python server.py --host <HOST> --port <PORT>
[OPTIONAL] --max-workers <MAX_NUM_WORKERS> --model-path <PATH_TO_CUSTOM_MODEL> --model-url <DOWNLOAD_URL>
- Implement CORS support for handling request from frontend
- Add method for multi-image request (unary-unary / stream-unary)
- Add environment variables
- Add docker support for deployment
- Add support for custom model integration
- Add service for instance / semantic segmentation, object tracking etc.
Contributions are welcome 😃