Lightweight NMS-free object detection with a familliar API.
Project description
FOTO-NET
FOTO-NET is a lightweight NMS-free object detector with a compact Python API and an application-friendly transform layer for working with detection boxes.
This is an alpha release. The architecture, training and validation contracts are implemented, but no evaluated pretrained weights are bundled and no public AP claim is made yet.
What It Is
FOTO-NET focuses on practical object detection:
- compact model scales
- NMS-free one-to-one inference
- optional one-to-many training supervision
- small-object friendly P2 variants
- direct Python results objects
- transform helpers for crops, anchors, pixel movement, containment, and box manipulation
- export paths for ONNX, TorchScript, TensorRT, and CoreML where dependencies are available
Alpha Status
The package is suitable for experimentation, integration testing, and training your own checkpoint. ONNX and TorchScript have automated parity checks; TensorRT/CoreML require their platform toolchains. Treat any named scale such as fotonetn as an untrained architecture until you load your own trusted checkpoint.
Install
pip install fotonet
Or
git clone https://github.com/hazegreleases/fotonet.git
cd fotonet
python -m pip install -e ".[dev]"
Quick Start
from fotonet import FOTONET
model = FOTONET("my_checkpoint.pt")
results = model.predict("image.jpg", conf=0.25)
result = results[0] # predict() consistently returns list[Results] for images
for box in result.boxes:
print(box.cls, box.conf, box.xyxy)
CLI:
fotonet predict model=my_checkpoint.pt source=image.jpg conf=0.25 save=true
Transform API
from fotonet import AnchorPoint
box = result.boxes[0]
crop = (
box.transform
.setAnchor(AnchorPoint.CENTER)
.pixelExpand(40)
.clamp()
.crop(result.orig_img)
)
The raw box formats remain available through box.xywh, box.xyxy, and result.boxes.numpy().
Training
FOTO-NET expects YOLO-format labels:
class_id x_center y_center width height
Train through Python:
from fotonet import FOTONET
model = FOTONET("fotonetn")
summary = model.train(data="data.yaml", epochs=100, imgsz=640, batch=16)
Train through CLI:
fotonet train model=fotonetn data=data.yaml epochs=100 imgsz=640 batch=16
Export
from fotonet import FOTONET
model = FOTONET("my_checkpoint.pt")
artifact = model.export(format="onnx", path="exports/fotonet.onnx", imgsz=640)
print(artifact["artifact"], artifact["metadata"])
Model Status
fotonetn is the current nano architecture. The following are architecture measurements, not accuracy claims: 2.24M parameters for the full train graph, 1.83M after stripping O2M heads for deployment, and 2.10 GMAC / 4.19 GFLOPs at 640×640 for the deploy graph. Reproducible AP belongs to a released checkpoint, dataset split, and evaluation command; none is published in this alpha.
Documentation
- Installation:
docs/installation.md - Quick start:
docs/quickstart.md - Inference:
docs/inference.md - Training:
docs/training.md - Export:
docs/export.md - Model configuration:
docs/model-config.md - Transform API:
docs/transform-api.md - Model zoo:
docs/model-zoo.md
License
FOTO-NET is licensed under the Apache License, Version 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fotonet-0.3.1a0-py3-none-any.whl.
File metadata
- Download URL: fotonet-0.3.1a0-py3-none-any.whl
- Upload date:
- Size: 184.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
255cded2c9c52ae8b20b16c67859a7840b923add9f725a59a4614d76bca811a6
|
|
| MD5 |
5b55b195e7ac519d5b96c145c70e26dc
|
|
| BLAKE2b-256 |
6c7b9bdf6a5a93b2f77886fcc81e5ad883220c351139e01d0a413b536690a034
|