Skip to main content

fotonet

Turkey Python PyTorch

fotonet is an open-source, NMS-free object-detection library for Python covering local inference, video tracking, training, validation, and model export.

Models

Model Generation Parameters Compute (640 × 640) COCO mAP50-95 Status
fotonet2n v2 (Hi Bird) 2.69M 6.41 GFLOPs 37.5 Available
fotonetn v1.1 (UltraDense) 2.85M 6.95 GFLOPs 32.1 Available
fotonets v1.1 (UltraDense) 11.49M 27.43 GFLOPs — Architecture in package
fotonetm v1.1 (UltraDense) 22.23M 63.38 GFLOPs — Architecture in package
fotonetl v1.1 (UltraDense) 70.32M 161.51 GFLOPs — Architecture in package
fotonete v1 1.70M 5.20 GFLOPs 17.1 Available

fotonet2n (Hi Bird, fotonet 2.0) reaches 37.5 mAP50-95 (55.6 mAP50, 40.0 mAP75) on COCO val2017 from a 300-epoch from-scratch single-GPU run in a 5.98 MB Apache-2.0 checkpoint with zero deployed BatchNorm2d layers and fixed [B, 300, nc+4] NMS-free outputs. fotonetn stays available at 32.1 mAP50-95 (fotonetn-ex.pt keeps the first 29.9 weights). See published weights and trainer 2.0.

Install

pip install fotonet

For a development checkout:

git clone https://github.com/iMGEai/fotonet.git
cd fotonet
pip install -e ".[dev]"

Quick start

Load the released checkpoint and run inference from Python:

from fotonet import Fotonet

model = Fotonet("fotonet2n")
results = model.predict("image.jpg", conf=0.25, imgsz=640)

for detection in results[0].boxes:
    print(detection.cls, detection.conf, detection.xyxy)  # pixel corners (x1, y1, x2, y2)

For a BGR frame from OpenCV:

frame = cv2.imread("image.jpg")
results = model.predict_bgr(frame, conf=0.25, imgsz=640)

Train

Training uses a YAML dataset configuration and writes checkpoints to a local run directory:

fotonet train \
  model=fotonet2n \
  data=path/to/data.yaml \
  epochs=100 \
  batch=16 \
  imgsz=640 \
  run_dir=runs/fotonet2n

Resume an interrupted run:

fotonet train \
  model=fotonet2n \
  data=path/to/data.yaml \
  resume=runs/fotonet2n/fotonet2n_last.pt

Weights and training outputs are not stored in the Git repository.

Export

from fotonet import Fotonet

model = Fotonet("fotonet2n")
output = model.export(
    format="onnx",
    path="exports/fotonet2n.onnx",
    imgsz=640,
)
print(output["artifact"])

See the export guide for ONNX, TensorRT, and TorchScript options.

Documentation

License

Apache License 2.0. See LICENSE.

Metadata

Release files for fotonet 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fotonet 2.0.0
File Size Uploaded Provenance Actions
fotonet-2.0.0.tar.gz 407.1 kB Without provenance Details for fotonet-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fotonet 2.0.0
File Interpreter ABI Platform Actions
fotonet-2.0.0-py3-none-any.whl Python 3 none any Details for fotonet-2.0.0-py3-none-any.whl

Total release size: 883.3 kB

Release files / fotonet-2.0.0.tar.gz

Download URL fotonet-2.0.0.tar.gz
Size 407.1 kB
Tags Source
SHA-256 checksum
How to use checksums
98621118a8de28534dbc4a390c95ab6ee451860a5ee381b37e88e282991baf58
BLAKE2b-256 checksum
How to use checksums
56fb74b713212a1267c4eb5eb3ec5617385ec4ba136a62db52214857fdb22830
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / fotonet-2.0.0-py3-none-any.whl

Download URL fotonet-2.0.0-py3-none-any.whl
Size 476.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9fe8a6e768297b21e9a023cf419ef9bc77e596e07e63fe0cc56a12a9b16da9fb
BLAKE2b-256 checksum
How to use checksums
fbeb3ff31c859a67759a672bd593f410059bea0e6c7bfe0d213986afe7e6b2f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Security for fotonet 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page