Instructions to use keeganyip/YOLOdetectors with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use keeganyip/YOLOdetectors with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("keeganyip/YOLOdetectors", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
Two single-class YOLOv8n detectors in safetensors
Two small object detectors (Ultralytics YOLOv8n, one class: shelter), converted from Ultralytics .pt checkpoints to
.safetensors plus a plain config.yaml. Nothing was retrained or modified: the tensors are those of the original
checkpoints, stored as fp16 (the precision the checkpoints were saved in).
| Folder | Files | Tensors | Weights SHA-256 |
|---|---|---|---|
se/ |
model.safetensors, config.yaml |
355 | 47db6e35833d8a08b726e1b68464129b93b1e9e2b1fead2a29172631c9776f3d |
ulp/ |
model.safetensors, config.yaml |
355 | 107b6419d946180ebf1ff212caa45803523bc32a6500563581d1299d734cafea |
SHA256SUMS lists every file: sha256sum -c SHA256SUMS. config.yaml holds only the model architecture and the class
names ({0: shelter}); the two configs are identical.
Verification
Each converted model was rebuilt through Ultralytics and compared with the original checkpoint:
- all 355 tensors load with
strict=True(no missing or unexpected keys); - the raw forward pass on a random input is identical (maximum difference 0.0);
- the full scan pipeline that uses these detectors returned identical detections on 19 test images for
ulp/; - for
se/, full-size scans of 4 large test images returned identical detections (positions within 1 px, confidences within 0.001).
Other inputs were not compared; the raw outputs being identical is the strongest evidence.
Use
import yaml
from safetensors.torch import load_file
from ultralytics import YOLO
model = YOLO("se/config.yaml") # builds the architecture (use ulp/config.yaml for the other)
model.model.load_state_dict({k: v.float() if v.dtype.is_floating_point else v
for k, v in load_file("se/model.safetensors").items()}, strict=True)
model.model.names = {int(k): v for k, v in yaml.safe_load(open("se/config.yaml"))["names"].items()}
results = model.predict("image.png", conf=0.5)
Tested with Ultralytics 8.4.158. The weights are stored in fp16; load them as float32 as above to match the original.
What is not included
The original .pt files, training data and training arguments are not part of this repository.
Licence
The weights are released under the GNU Affero General Public License v3.0, as for Ultralytics YOLO models (https://github.com/ultralytics/ultralytics, https://www.ultralytics.com/license). The base model is Ultralytics YOLOv8n. This repository is an unofficial conversion and is not affiliated with Ultralytics.
Intended use and limits
Single-class detectors tuned for one narrow task. They are not general-purpose detectors, and nothing beyond the checks above was evaluated.
- Downloads last month
- -