This repository is an example of YOLOv8-based Brand Logo Detection model trained on Nike logo images. It contains of a Nike logo detection library as well as a dockerized API for photo detection.
Dataset with Nike logos consists with Instagram posts of official Nike accounts or posts with Nike hashtags. Collected data was annotated manually using Roboflow. The final dataset for training can be found here:
https://universe.roboflow.com/mikhail-korotkov/brand-logos-f5red
You can train similar model by using train.py from nike_detector.nike_detector.service
At first you will need to install roboflow and ultralytics:
pip install roboflow
pip install ultralytics
To use Nike logo detection you need to install it using pip:
pip install nike_detection==0.0.18
To run detection on your image:
from PIL import Image
from nike_detector.nike_detector.service.service import init_nike_model, predict
# initialize model
model = init_nike_model()
# load image
im = Image.open("your_image_name.jpg")
# run detection
results = predict(im)
Similar for tracking:
from nike_detector.nike_detector.service.service import init_nike_model, track
video = 'you_video_name.mp4'
# initialize model
model = init_nike_model()
# run tracking
results = track(video, False, False)
You can also run this model in a Docker container. It is a basic version of FastApi with one endpoint "vectorize_batch" for detection. You can easily build this image using:
docker build -f Dockerfile -t you_image_name:v1.0.0 .
and run the container with:
docker run -p 8021:8021 you_image_name:v1.0.0