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

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 Weights

The alpha repository includes fotonet-n as the public nano checkpoint. Training outputs and development weights live outside the public surface.

Alpha Checkpoint Metrics

fotonet-n is the alpha nano checkpoint included in this repository.

Checkpoint mAP@.50:.95 Parameters MACs at 640 GFLOPs at 640
fotonet-n 22.68% 2.75M 2.43G 4.85G

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: fotonet-0.1.0a0.tar.gz
  • Upload date:
  • Size: 84.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.1.0a0.tar.gz
Algorithm Hash digest
SHA256 f3b2e573deea24c7c7aaa0ca1861cc8c8fb85fb4ca8d18b017c054cbdb3af464
MD5 d7422aa1467d8e57c38e2fc17ea8777d
BLAKE2b-256 8eb31befa37c937e055786fd2b29897ab18e38138cd042b96decb94c7ffeab2b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fotonet-0.1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 89.8 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.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 db1c7d2710002bf44d051b9c6c589a3c7028bdf30420293a2d65d604c2846e5b
MD5 c1e42c6dfbfb2318c9381c5061d06d29
BLAKE2b-256 73c62a8165370a86b9d6f16e68847e7b7b6c098cc53883cf2af6f7077553a624

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