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.1.0a0.tar.gz (99.3 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.1.0a0-py3-none-any.whl (104.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fotonet-0.2.1.0a0.tar.gz
  • Upload date:
  • Size: 99.3 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.1.0a0.tar.gz
Algorithm Hash digest
SHA256 90b61a05a38dfd4cb8916851190ed1e40b9894a9aafebc7cef1ccc3c82f75428
MD5 3b20a8f19bc8057a3b4a85b973fa3337
BLAKE2b-256 76443021a97ead816ddbc8a241a37355539f9c06dedcfb9716d2f95f2bcf3761

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fotonet-0.2.1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 104.5 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.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ec25a591f8934405b421b28c7308ea36f91599e721cb80dece23ebaa8f5022d
MD5 d20546b096d8c48aaad259261e89cd2b
BLAKE2b-256 dadd7b1e9bf037806e528fccfe153c313f7b982721974685fcb62ebf3b2a1f05

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