Metadata-Version: 2.4
Name: fomo-edge-ai
Version: 0.0.11
Summary: FOMO - Lightweight Point Localization models.
Author-email: Bence Danko <bencejdanko@gmail.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/fomo-edge-ai/fomo
Project-URL: Repository, https://github.com/fomo-edge-ai/fomo
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.19.0
Requires-Dist: Pillow>=8.0.0
Requires-Dist: torch>=1.13.0
Requires-Dist: torchvision>=0.11.0
Requires-Dist: PyYAML>=6.0
Requires-Dist: requests>=2.25.0
Requires-Dist: opencv-python>=4.11.0.86
Requires-Dist: scipy>=1.7.0
Requires-Dist: safetensors>=0.4.0
Requires-Dist: tqdm>=4.64.0
Requires-Dist: litert-torch==0.9.1
Requires-Dist: ai-edge-quantizer-nightly==0.8.0.dev20260602
Dynamic: license-file

# FOMO: Fast Object Localization

FOMO is a lightweight point localization model designed for edge AI applications. Instead of regressing bounding boxes, FOMO downsamples the input image (for example, mapping a 192x192 input to a 24x24 grid) and predicts class probabilities and coordinates on a per-cell basis.

## Installation

Install the package via PyPI:

```bash
pip install fomo-edge-ai
```

## Usage

```python
# Model 
from fomo import FOMO
model = FOMO(model_path=None, size="s", nb_classes=1, device="cpu")

# Training

results = model.train(
    allow_experimental=True,
    data=str(data_yaml_path),   # YOLO style data.yaml
                                # Only bounding-box style datasets supported.
                                # TODO: add support for point-level annotation datasets
    epochs=EPOCHS,
    batch=BATCH,
    lr0=3e-4,
    eval_interval=1,
    workers=2,
    device=device,
    project=PROJECT,
    name=RUN_NAME,
    exist_ok=True,
    patience=0,
)

# Export as TFLite model

fp32_path = trained.export(output_path=str(weights_dir / f"{RUN_NAME}_fp32.tflite"))

# INT8 Quantization

int8_path = quantizer.quantize(
    fp32_tflite=fp32_path,
    calibration_data=calib_iter,
    config=config,
    output_path=str(weights_dir / f"{RUN_NAME}_int8.tflite")
)


```

## Model Hosting

Models are currently available on Hugging Face: 

https://huggingface.co/fomo-edge-ai/FOMO

## Examples

Refer to `examples/` for detailed examples on training and inference.

## Tests 

Tests are completed using [modal](https://modal.com/). Install the modal cli and run

```
make test
```

## License

Code is licensed under the Apache License 2.0. Pre-trained weights are hosted externally and may inherit separate licensing terms. Check details in the specific weight repositories.
