Services for continuous object detection with YOLOv8 models and openCV
To deploy the create the docker image, run the following command inside the folder where is the dockerfile.
sudo docker build -t inference-server .
To run the container image:
docker-compose up -d
or
docker run -d --name inference-server -p 8000:8000 -v ~/inference-server:/service/logs --restart=always inference-server
- python3.11
- python3.11-pip
- libgl1-mesa-dev
- yolovXn.pt
- yolovXs.pt
- yolovXm.pt
- yolovXl.pt
- yolovXx.pt
The yaml_path must be the path from the datasets folder
from src.train_model import train_model
if __name__ == '__main__':
yaml : str = 'pothole/data.yaml'
train_name : str = 'baches'
train_model(yaml, train_name)
if __name__ == '__main__':
while True:
try:
my_model = Predictor(model_name='yolov5xu.pt')
my_model.keep_prediction() # or my_model.single_prediction()
except Exception as e:
if e == KeyboardInterrupt:
break
pass