Skip to main content

Lightweight NMS-free object detection with a familliar API.

Project description

FOTO-NET alpha banner

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fotonet-0.3.0a0.tar.gz (179.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fotonet-0.3.0a0-py3-none-any.whl (185.0 kB view details)

Uploaded Python 3

File details

Details for the file fotonet-0.3.0a0.tar.gz.

File metadata

  • Download URL: fotonet-0.3.0a0.tar.gz
  • Upload date:
  • Size: 179.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for fotonet-0.3.0a0.tar.gz
Algorithm Hash digest
SHA256 b74c121e999fab28477d21ea798197b194763452a17362e249c5724e0b8089af
MD5 982a83c28f9299c638c19688989ce732
BLAKE2b-256 9f5bd42d1e6d00f17ec732a370bbf299d1e377c868e2358e8c9946977678d157

See more details on using hashes here.

File details

Details for the file fotonet-0.3.0a0-py3-none-any.whl.

File metadata

  • Download URL: fotonet-0.3.0a0-py3-none-any.whl
  • Upload date:
  • Size: 185.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for fotonet-0.3.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 9263529a4d46308aec904e20acbcad339f03a1cd8027ebe92c19828b746640be
MD5 c2c2e07939a01dbe49715aa43e4ce460
BLAKE2b-256 c6efc1fbc8a00492de12bad9053783bedf661c15b2af2b5bc8f6f9eb61900c29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page