Skip to main content

Lightweight NMS-free object detection with an Ultralytics-like API.

Project description

FOTO-NET alpha banner

FOTO-NET

FOTO-NET is a lightweight NMS-free object detector with an Ultralytics-like Python API and an application-friendly transform layer for working with detection boxes.

This is the alpha release, everything is subject to change. Not recommended for production workflows, just a demo of what is coming.

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 alpha release is intended for experimentation, training runs, integration tests, and feedback. The core Python API, training path, inference path, transform API, and ONNX export should be usable. CoreML export code exists, but it should not be treated as certified until fresh platform-specific verification is published.

Install

pip install fotonet

Or

git clone https://github.com/hazegreleases/fotonet.git
cd fotonet
python -m pip install torch torchvision numpy pillow pyyaml opencv-python matplotlib scipy tqdm

Quick Start

from fotonet import FOTONET

model = FOTONET("fotonetn")
results = model.predict("image.jpg", conf=0.25)

for box in results.boxes:
    print(box.cls, box.conf, box.xyxy)

CLI:

python -m fotonet.cli.main predict model=fotonet-n source=image.jpg conf=0.25 save=true

Transform API

from fotonet import AnchorPoint

box = results.boxes[0]
crop = (
    box.transform
    .setAnchor(AnchorPoint.CENTER)
    .pixelExpand(40)
    .clamp()
    .crop(results.orig_img)
)

The raw box formats remain available through box.xywh, box.xyxy, and results.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")
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("fotonet-n")
model.export(format="onnx", path="dev-tools/runs/fotonet.onnx", imgsz=640)

Model Status

The alpha package includes the fotonetn nano architecture. Training outputs and development weights live outside the public surface.

Alpha Model Metrics

fotonetn is the current nano architecture. The public alpha training run is in progress.

Model mAP@.50:.95 Parameters MACs at 640 GFLOPs at 640
fotonetn [Training] 3.88M 2.35G 4.69G

Inference times are not out yet because the benchmark computer is IO bottlenecked, so the timing numbers are not reliable enough to publish.

Documentation

  • Installation: docs/installation.md
  • Quick start: docs/quickstart.md
  • Inference: docs/inference.md
  • Training: docs/training.md
  • Export: docs/export.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.2.2.0a0.tar.gz (100.1 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.2.2.0a0-py3-none-any.whl (105.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fotonet-0.2.2.0a0.tar.gz
Algorithm Hash digest
SHA256 e74b153d82c61fad280dcdbae76b79a9bb5df3f790699d197891de0457b32988
MD5 855e56510b969cf113daba6ea4eebd04
BLAKE2b-256 6506d5a75c39fe736336ab593c13bef040e1695bb944f0ddbad326aee883e76c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fotonet-0.2.2.0a0-py3-none-any.whl
  • Upload date:
  • Size: 105.3 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.2.2.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 a50e9ee5c19668529abfc907f247788cfc537dde864101dccc9e3044853c97a3
MD5 b05c9e00a233dc115c23c6e4f92f44ac
BLAKE2b-256 6471725540d279496efa102e0d0966a8e2742794b96f06468d64367f84d3d372

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