AI Image Classification model for sorting my photos
Source: https://huggingface.co/ultralyticsplus/yolov8s
Uses the Yolo8 model for classification.
pre-requisites:
- install ultralyticsplus: pip install -U ultralyticsplus==0.0.14
load model and preform prediction: from ultralyticsplus import YOLO, render_result
model = YOLO('ultralyticsplus/yolov8s')
model.overrides['conf'] = 0.25 # NMS confidence threshold model.overrides['iou'] = 0.45 # NMS IoU threshold model.overrides['agnostic_nms'] = False # NMS class-agnostic model.overrides['max_det'] = 1000 # maximum number of detections per image
image = 'https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg'
results = model.predict(image)
print(results[0].boxes) render = render_result(model=model, image=image, result=results[0]) render.show()