Instructions to use BVRA/TurtleDetector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use BVRA/TurtleDetector with ultralytics:
# Couldn't find a valid YOLO version tag. # Replace XX with the correct version. from ultralytics import YOLOvXX model = YOLOvXX.from_pretrained("BVRA/TurtleDetector") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
| import os | |
| from ultralytics import YOLO | |
| project = f"{os.getcwd()}/runs" | |
| device = "cuda:2" | |
| imgsz = 640 | |
| epochs = 20 | |
| # Stage 1: Pretrain on SeaTurtleID2022 (large dataset) | |
| model = YOLO("yolo11s-seg.pt") | |
| model.train( | |
| data="segmentation_stage1.yaml", | |
| project=project, | |
| name="stage1", | |
| epochs=epochs, | |
| imgsz=imgsz, | |
| device=device, | |
| fliplr=0, | |
| flipud=0, | |
| ) | |
| # Stage 2: Fine-tune on combined dataset (balanced) | |
| model = YOLO(f"{project}/stage1/weights/last.pt") | |
| model.train( | |
| data="segmentation_stage2.yaml", | |
| project=project, | |
| name="stage2", | |
| epochs=epochs, | |
| imgsz=imgsz, | |
| device=device, | |
| fliplr=0, | |
| flipud=0, | |
| freeze=5, | |
| ) | |