Card Patches Detection¶
Introduction¶
This package has built-in support for detecting card patches in an image. This feature is useful for detecting color checker cards in an image. The detection is based on the YOLOv8 model. You can use the YOLOv8CardDetector
class to detect card patches in an image.
| | | | |
Usage¶
If you don't have image to test
You can download the sample image from the following link:
import cv2
from color_correction import YOLOv8CardDetector
from color_correction.schemas.det_yv8 import DetectionResult
image = cv2.imread("your_image_path")
detector = YOLOv8CardDetector(
conf_th=0.15,
iou_th=0.7,
use_gpu=False, # (1)
)
result: DetectionResult = detector.detect(image=image)
drawed_image = result.draw_detections(image=image)
cv2.imwrite("drawed_detection.jpg", drawed_image)
- 💬 The model runs using onnx , which supports both CPU and GPU. The model will be automatically downloaded if not already present on your system.