Skip to main content

fotonet

fotonet is a compact Python object-detection library for local inference, training, evaluation, and model export. The supported model is fotonete.

Install

python -m pip install fotonet

For a development checkout:

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

Quick start

Download a release checkpoint, then run inference from Python:

from fotonet import Fotonet

model = Fotonet("path/to/fotonet_last.pt")
results = model.predict("image.jpg", conf=0.25, imgsz=640)

for detection in results[0].boxes:
    print(detection.cls, detection.conf, detection.xyxy)

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=fotonete \
  data=path/to/data.yaml \
  epochs=300 \
  batch=16 \
  imgsz=640 \
  run_dir=runs/fotonete

Resume an interrupted run:

fotonet train \
  model=fotonete \
  data=path/to/data.yaml \
  resume=runs/fotonete/fotonet_last.pt

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

Export

from fotonet import Fotonet

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

See the export guide for available formats and optional dependencies.

Documentation

License

Apache License 2.0. See LICENSE.

Release files for fotonet 1.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 1.0.0
File Size Uploaded
fotonet-1.0.0.tar.gz 181.3 kB Details

Built distribution (wheel)

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

Total release size: 381.4 kB

Release files / fotonet-1.0.0.tar.gz

Download URL fotonet-1.0.0.tar.gz
Size 181.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9d7f65881a5cf8acba2cbee95cd239f779c7a5be6b1e4388e219cb08807fd3dc
BLAKE2b-256 checksum
How to use checksums
215d38c147e9724069359161cdd8884f2fd19c33083c96b136af54b3f55b3427
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

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

Download URL fotonet-1.0.0-py3-none-any.whl
Size 200.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bdfbe005fc71103e8c4f18407d6d393007e574df5d712e6e0af6c5072a3f36b1
BLAKE2b-256 checksum
How to use checksums
cbd6d9775de9ada7f2ae11255a93783cb280017a524f60b89520789f7377ddac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11
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