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.0.1a0.tar.gz (97.2 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.0.1a0-py3-none-any.whl (102.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fotonet-0.2.0.1a0.tar.gz
  • Upload date:
  • Size: 97.2 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.0.1a0.tar.gz
Algorithm Hash digest
SHA256 75086ac9eb1f76a1fa5d07b9e3cad7f97396cfa7ddf1eaf82726967cf45e9bf8
MD5 3fbc8a24a1c2e83ed83b4d71d92f8c34
BLAKE2b-256 9664d0795f06f27a8f1e22fcb2f428b2615df2b60b8890c0a3756bc624553a53

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fotonet-0.2.0.1a0-py3-none-any.whl
  • Upload date:
  • Size: 102.4 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.0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 0663af048ad58153150926a5b7b4992c8ff3185261a1cd9142caec9a3820d8cb
MD5 72a9ad49bfaab77fc0d899c0c941358d
BLAKE2b-256 68a9d4cda9debf8b8b7eb1793568a0a6f53f1fde3a21f96b6a058f96105ced5e

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