sahi

Framework agnostic sliced/tiled inference + interactive ui + error analysis plots

MIT License

Downloads
160.6K
Stars
3.6K
Committers
38

Bot releases are hidden (Show)

sahi - v0.10.5

Published by fcakyon about 2 years ago

What's Changed

bugfix

other

Full Changelog: https://github.com/obss/sahi/compare/0.10.4...0.10.5

sahi - v0.10.4

Published by fcakyon about 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/obss/sahi/compare/0.10.3...0.10.4

sahi - v0.10.3

Published by fcakyon about 2 years ago

What's Changed

Full Changelog: https://github.com/obss/sahi/compare/0.10.2...0.10.3

sahi - v0.10.2

Published by fcakyon about 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/obss/sahi/compare/0.10.1...0.10.2

sahi - v0.10.1

Published by fcakyon over 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/obss/sahi/compare/0.10.0...0.10.1

sahi - v0.10.0

Published by fcakyon over 2 years ago

New Features

- Layer.ai integration

from sahi import AutoDetectionModel

detection_model = AutoDetectionModel.from_layer("layer/yolov5/models/yolov5s")

result = get_sliced_prediction(
    "image.jpeg",
    detection_model,
    slice_height = 512,
    slice_width = 512,
    overlap_height_ratio = 0.2,
    overlap_width_ratio = 0.2
)

- HuggingfFace Transformers object detectors

from sahi.model import HuggingfaceDetectionModel

detection_model = HuggingfaceDetectionModel(
    model_path="facebook/detr-resnet-50",
    image_size=640,
    confidence_threshold=0.5
)

result = get_sliced_prediction(
    "image.jpeg",
    detection_model,
    slice_height = 512,
    slice_width = 512,
    overlap_height_ratio = 0.2,
    overlap_width_ratio = 0.2
)

- TorchVision object detectors

import torchvision
from sahi.model import TorchVisionDetectionModel

model = torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=True)

detection_model = TorchVisionDetectionModel(
    model=model,
    image_size=640,
    confidence_threshold=0.5
)

result = get_sliced_prediction(
    "image.jpeg",
    detection_model,
    slice_height = 512,
    slice_width = 512,
    overlap_height_ratio = 0.2,
    overlap_width_ratio = 0.2
)

- Support for exporting predictions in COCO format

from sahi.utils.coco import Coco, CocoImage, CocoAnnotation, CocoPrediction
from sahi.utils.file import save_json
from pycocotools.cocoeval import COCOeval
from pycocotools.coco import COCO

coco_obj = Coco()

# add n images to coco_obj
for _ in range(n):
    image = CocoImage(**kwargs)
    
    # add n annotations to the image
    for _ in ange(n):
        image.add_annotation(CocoAnnotation(**kwargs))
    
    # add n predictions to the image
    for _ in range(n)
        image.add_prediction(CocoPrediction(**kwargs))
    
    # add image to coco object
    coco_obj.add_image(image)

# export ground truth annotations
coco_gt = coco_obj.json
save_json(coco_gt , "ground_truth.json")

# export predictions 
coco_predictions = coco_obj.prediction_array
save_json(coco_predictions, "predictions.json")

coco_ground_truth = COCO(annotation_file="coco_dataset.json")
coco_predictions = coco_ground_truth.loadRes("coco_predictions.json")
coco_evaluator = COCOeval(coco_ground_truth, coco_predictions, "bbox")
coco_evaluator.evaluate()
coco_evaluator.accumulate()
coco_evaluator.summarize()

What's Changed

New Contributors

Full Changelog: https://github.com/obss/sahi/compare/0.9.4...0.10.0

sahi - v0.9.4

Published by fcakyon over 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/obss/sahi/compare/0.9.3...0.9.4

sahi - v0.9.3

Published by fcakyon over 2 years ago

What's Changed

sahi-video-inf

New Contributors

Full Changelog: https://github.com/obss/sahi/compare/0.9.2...0.9.3

sahi - v0.9.2

Published by fcakyon over 2 years ago

What's Changed

Full Changelog: https://github.com/obss/sahi/compare/0.9.1...0.9.2

sahi - v0.9.1

Published by fcakyon over 2 years ago

What's Changed

Full Changelog: https://github.com/obss/sahi/compare/0.9.0...0.9.1

sahi - v0.9.0

Published by fcakyon over 2 years ago

detectron2

What's Changed

New Contributors

Full Changelog: https://github.com/obss/sahi/compare/0.8.22...0.9.0

sahi - v0.8.22

Published by fcakyon almost 3 years ago

What's Changed

Full Changelog: https://github.com/obss/sahi/compare/0.8.20...0.8.22

sahi - v0.8.20

Published by fcakyon almost 3 years ago

What's Changed

Full Changelog: https://github.com/obss/sahi/compare/0.8.19...0.8.20

sahi - v0.8.19

Published by fcakyon almost 3 years ago

What's Changed

Full Changelog: https://github.com/obss/sahi/compare/0.8.18...0.8.19

sahi - v0.8.18

Published by fcakyon almost 3 years ago

What's Changed

Full Changelog: https://github.com/obss/sahi/compare/0.8.16...0.8.18

sahi - v0.8.16

Published by fcakyon almost 3 years ago

What's Changed

Full Changelog: https://github.com/obss/sahi/compare/0.8.15...0.8.16

sahi - v0.8.15

Published by fcakyon almost 3 years ago

What's Changed

Full Changelog: https://github.com/obss/sahi/compare/0.8.14...0.8.15

sahi - v0.8.14

Published by fcakyon almost 3 years ago

What's Changed

Full Changelog: https://github.com/obss/sahi/compare/0.8.13...0.8.14

sahi - v0.8.13

Published by fcakyon almost 3 years ago

What's Changed

Full Changelog: https://github.com/obss/sahi/compare/0.8.12...0.8.13

sahi - v0.8.12

Published by fcakyon almost 3 years ago

Check YOLOX + SAHI demo:

What's Changed

Full Changelog: https://github.com/obss/sahi/compare/0.8.11...0.8.12

Package Rankings
Top 25.44% on Conda-forge.org
Top 1.59% on Pypi.org
Related Projects