Releases: FocoosAI/focoos
Releases · FocoosAI/focoos
Release v0.25.0
0.25.0 (2025-12-11)
Adds full support for non-square image sizes with CLI parsing, data/augmentation/mappers/processors updates, inference/export benchmarking changes, and docs/examples; also updates AutoDataset.get_split to accept DatasetAugmentations.
- Image size handling (core):
- Make
ModelInfo.im_sizeacceptint | (H, W); propagate throughTrainerArgs, processors, mappers, and ports. - Update processors (
DETR,RTMO,MaskFormer,BisenetFormer,Classification) to accept tuple sizes and resize accordingly.
- Make
- Adjust inference runtimes (ONNX, TorchScript, base model) warmup/benchmark to support non-square and log proper size; set latency
im_sizeusing height. - CLI:
- Add
parse_im_sizeto accept"640","640,480", or"640x480". - Change
train,val, andexport--im-sizeoption to string, parse toint | (H, W)and pass through.
- Add
- Data pipeline:
DatasetAugmentations.resolutionnowint | (H, W); non-square uses directResize, square keepsResizeShortestEdge; adjust crop to use absolute size.get_default_by_taskand all call sites now pass/returnDatasetAugmentations(not raw list).AutoDataset.get_split(augs=...)now expectsDatasetAugmentationsand forwards both augs andresolution; remove.get_augmentations()usage across code/tests/tutorials.- Mappers carry
resolution;MapDatasetexposesresolutionproperty.
- Export/Training:
export_commandand model export accept tuple sizes; setmodel_info.im_sizeto the provided resolution.- After training, always reload best model/info and set model/processor to eval.
- Docs:
- Update README and docs (CLI, concepts, inference, training) with non-square examples and usage notes.
What's Changed
- feat: enhance image size handling across the codebase by @CuriousDolphin in #167
Full Changelog: v0.24.0...v0.25.0
Release v0.24.0
Release v0.23.0
0.23.0 (2025-10-21)
Features
- device: enhance MPS support (1ebec24)
- device: improve device selection logic for training (b64f999)
- gpu: add MPS availability to GPUInfo and update focoos version (a4412be)
- hub: add IMAGE_CLASSIFIER to supported model families (6724fab)
- system: enhance archive extraction by removing __MACOSX directory and validating train/validation splits (3dedbae)
Bug Fixes
- amp: enable automatic mixed precision by default and add CUDA availability check (0c23ca0)
Code Refactoring
- system: rename list_dir to list_directories and streamline directory validation (058b6b2)
What's Changed
Full Changelog: v0.22.0...v0.23.0
Release v0.22.0
Release v0.21.0
0.21.0 (2025-09-29)
Features
- catalog: update cls model configurations and add coco_2017_cls dataset (dee2b02)
- model_registry: update focoos version and latency metrics and fix stdc config (bc96afb)
- model_registry: update model description for fai-cls-n-coco (181faa2)
- torchscript: enhance warmup size logic for model detection and classification and update quantization tutorial (c670049)
Bug Fixes
- backbone: update model loading to use CPU mapping (5b6c20b)
What's Changed
- Optimize classification models by @CuriousDolphin in #159
Full Changelog: v0.20.2...v0.21.0
Release v0.20.2
0.20.2 (2025-09-26)
Bug Fixes
- README.md: fix spelling in Python sample code (3992d51)
What's Changed
Full Changelog: v0.20.1...v0.20.2
Release v0.20.1
0.20.1 (2025-09-26)
Build Systems
- devcontainer: cpu: remove deprecated extension (2ab82c3)
- devcontainer: gpu: remove deprecated extension (ba61a93)
- devcontainer: tensorrt: remove deprecated extension (9daf17d)
What's Changed
New Contributors
Full Changelog: v0.20.0...v0.20.1
Release v0.20.0
0.20.0 (2025-09-24)
🚀 Key Changes
✨ Introduce classification models
- add fai-cls-n/s/m-coco classification pretrained model
- compatible training datasets:
- DatasetLatout.ROBOFLOW_COCO (multi-class)
- DatasetLatout.CLS_FOLDER (multi-class)
- compatible training datasets:
from focoos import ModelManager
from PIL import Image
im = "https://public.focoos.ai/samples/federer.jpg"
model = ModelManager.get("fai-cls-m-coco")
detections = model.infer(im, annotate=True, threshold=0.5)
Image.fromarray(detections.image) # visualise or save annotated image🛠️ Add new export parameters
- add simplify_onnx (bool) parameter to simplify onnx graph with huggingface optimum
- add dynamic_axes (bool) parameter
from focoos import ModelManager
from PIL import Image
im = "https://public.focoos.ai/samples/federer.jpg"
model = ModelManager.get("fai-cls-n-coco")
exported_model = model.export(runtime_type=RuntimeType.ONNX_CPU,
dynamic_axes=False,
simplify_onnx=True)🤖 add quantization for classification models
- support QDQ and QO onnx quantization for classification models
from focoos import ASSETS_DIR,RuntimeType
from focoos.infer.quantizer import OnnxQuantizer, QuantizationCfg
quantization_cfg = QuantizationCfg(
size=image_size, # input size: must be same as exported model
calibration_images_folder=str(ASSETS_DIR), # Calibration images folder: It is strongly recommended
# to use the dataset validation split on which the model was trained.
# Here, for example, we will use the assets folder.
format="QDQ", # QO (QOperator): All the quantized operators have their own ONNX definitions, like QLinearConv, MatMulInteger etc.
# QDQ (Quantize-DeQuantize): inserts DeQuantizeLinear(QuantizeLinear(tensor)) between the original operators to simulate the quantization and dequantization process.
per_channel=True, # Per-channel quantization: each channel has its own scale/zero-point → more accurate,
# especially for convolutions, at the cost of extra memory and computation.
normalize_images=True, # normalize images during preprocessing: some models have normalization outside of model forward
)
quantizer = OnnxQuantizer(
input_model_path=model_path,
cfg=cfg
)
quant_model_path = quantizer.quantize(benchmark=True)
quantized_model = InferModel(quant_model_path,runtime_type=RuntimeType.ONNX_CPU)🏞️ Datasets
- filter images without annotation in training and validation split
🤖 InferModel
- use full model path instead of model folder
📖 Docs
- add classification models docs
- add quantization docs
- add quantization notebook
🛠️ Misc
- update logging with more human readable print
🛠️ Deps
- add Huggingface Optimum
- remove OnnxSlim
Full Changelog: v0.19.1...v0.20.0
Release v0.19.1
0.19.1 (2025-09-09)
Bug Fixes
What's Changed
- fix(InferModel): onnx cpu inference by add device parameter by @CuriousDolphin in #149
Full Changelog: v0.19.0...v0.19.1
Release v0.19.0
0.19.0 (2025-08-25)
Key Changes
✨ Introduce keypoints models
- add RTMO-S/M/L-COCO keypoint pretrained model
example:
from focoos import ModelManager
from PIL import Image
im = "https://public.focoos.ai/samples/federer.jpg"
model = ModelManager.get("rtmo-s-coco")
detections = model.infer(im,annotate=True, threshold=0.5)
Image.fromarray(detections.image) # visualise or save annotated image📷 Unified Inference API
Standardize infer Method Signatures
- consistent infer() method across FocoosModel, InferModel, and RemoteModel with unified parameters:
infer(image, threshold=0.5, annotate=False)and use unified image loader for infer methods (with also remote image support) - add default threshold to 0.5
- Remove dependency on external annotate_image() function calls
- Streamlined workflow: get detections and visual annotations in a single call
example torch and exported model:
from focoos import ModelManager, RuntimeType
from PIL import Image
im = "https://public.focoos.ai/samples/motogp.jpg" # remote image, can also be local path, numpy array, or PIL image
model = ModelManager.get("fai-detr-l-obj365")
detections = model.infer(im,annotate=True, threshold=0.5) # annotatate param
# Image.fromarray(detections.image) # visualise or save annotated image
# export model
model = model.export(RuntimeType.ONNX_CUDA32)
res = model.infer(im, annotate=True, threshold=0.5)
Image.fromarray(detections.image) # visualise or save annotated imageexample with remote inference:
from focoos import FocoosHUB
from PIL import Image
hub = FocoosHUB()
model_ref = "fai-detr-l-obj365" # use any of pretrained model on app.focoos.ai or your own model reference
remote_model = hub.get_remote_model(model_ref)
im = "https://public.focoos.ai/samples/federer.jpg"
detections = remote_model.infer(im,annotate=True, threshold=0.5)
Image.fromarray(detections.image) # visualise or save annotated imageEnhanced FocoosDetections Structure
- add new image field: stores annotated results as base64 string or numpy array
- migrated from Pydantic to pure Python dataclasses for better performance,
Improved serialization and memory usage - add new keypoints field
- add pprint and print_infer methods to unify detections prints.
⌨️ CLI
- add new CLI command:
focoos gradioto launch a Gradio interface for image and video inference using Focoos pretrained models.
🕹️ Trainer
- fix missing model preprocessing when
amp=True(Automatic Mixed Precision) is enabled - add
COSINEscheduler quadratic warmup - add
KeypointEvaluator - enhance logging with additional info
- Update
Visualizer(preview hook) to save RGB images instead of BGR - Restore TensorBoard Hook
📖 ModelRegistry
- model registry now support automatic loading json configs from registry folder instead of declare model configs manually
🏞️ Processor
- add
image_sizeinto init instead of preprocess methods - improve image loader performance
- add non-blocking image transfer
- optimize preprocessor speed
- add focoos palette to annotators
📖 Docs
- add RTMO docs
- update Readme, Docs and notebook with
from focoos import xfor all exported classes and functions instead of absolute path
What's Changed
- Introduce Keypoint Models: YoloXPose & RTMO by @CuriousDolphin in #120
Full Changelog: v0.18.1...v0.19.0