Package: sahi
SAHI: Slicing Aided Hyper InferenceA lightweight vision library for performing large scale object detection & instance segmentation​OverviewObject detection and instance segmentation are by far the most important fields of applications in Computer Vision. However, detection of small objects and inference on large images are still major issues in practical usage. Here comes the SAHI to help developers overcome these real-world problems with many vision utilities.CommandDescriptionpredictperform sliced/standard video/image prediction using anyyolov5/mmdet/detectron2/huggingfacemodelpredict-fiftyoneperform sliced/standard prediction using anyyolov5/mmdet/detectron2/huggingfacemodel and explore results infiftyone appcoco sliceautomatically slice COCO annotation and image filescoco fiftyoneexplore multiple prediction results on your COCO dataset withfiftyone uiordered by number of misdetectionscoco evaluateevaluate classwise COCO AP and AR for given predictions and ground truthcoco analysecalcualate and export many error analysis plotscoco yolov5automatically convert any COCO dataset toyolov5formatQuick Start Examples📜 List of publications that cite SAHI (currently 40+)🏆 List of competition winners that used SAHITutorialsIntroduction to SAHIOfficial paper(ICIP 2022 oral) (NEW)Pretrained weights and ICIP 2022 paper files'Exploring SAHI' Research Article from 'learnopencv.com'(2023) (NEW)'VIDEO TUTORIAL: Slicing Aided Hyper Inference for Small Object Detection - SAHI'(2023) (NEW)Video inference support is liveKaggle notebookSatellite object detectionError analysis plots & evaluation(NEW)Interactive result visualization and inspection(NEW)COCO dataset conversionSlicing operation notebookYOLOX+SAHIdemo:(RECOMMENDED)YOLOv5+SAHIwalkthrough:MMDetection+SAHIwalkthrough:Detectron2+SAHIwalkthrough:HuggingFace+SAHIwalkthrough:(NEW)TorchVision+SAHIwalkthrough:(NEW)InstallationInstallation details:Installsahiusing pip:pip install sahiOn Windows,Shapelyneeds to be installed via Conda:conda install -c conda-forge shapelyInstall your desired version of pytorch and torchvision (cuda 11.3 for detectron2, cuda 11.7 for rest):conda install pytorch=1.10.2 torchvision=0.11.3 cudatoolkit=11.3 -c pytorchconda install pytorch=1.13.1 torchvision=0.14.1 pytorch-cuda=11.7 -c pytorch -c nvidiaInstall your desired detection framework (yolov5):pip install yolov5==7.0.4Install your desired detection framework (mmdet):pip install mmcv-full==1.7.0 -f https://download.openmmlab.com/mmcv/dist/cu117/torch1.13.0/index.htmlpip install mmdet==2.26.0Install your desired detection framework (detectron2):pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.htmlInstall your desired detection framework (huggingface):pip install transformers timmFramework Agnostic Sliced/Standard PredictionFind detailed info onsahi predictcommand atcli.md.Find detailed info on video inference atvideo inference tutorial.Find detailed info on image/dataset slicing utilities atslicing.md.Error Analysis Plots & EvaluationFind detailed info atError Analysis Plots & Evaluation.Interactive Visualization & InspectionFind detailed info atInteractive Result Visualization and Inspection.Other utilitiesFind detailed info on COCO utilities (yolov5 conversion, slicing, subsampling, filtering, merging, splitting) atcoco.md.Find detailed info on MOT utilities (ground truth dataset creation, exporting tracker metrics in mot challenge format) atmot.md.CitationIf you use this package in your work, please cite it as:@article{akyon2022sahi,
  title={Slicing Aided Hyper Inference and Fine-tuning for Small Object Detection},
  author={Akyon, Fatih Cagatay and Altinuc, Sinan Onur and Temizel, Alptekin},
  journal={2022 IEEE International Conference on Image Processing (ICIP)},
  doi={10.1109/ICIP46576.2022.9897990},
  pages={966-970},
  year={2022}
}@software{obss2021sahi,
  author       = {Akyon, Fatih Cagatay and Cengiz, Cemil and Altinuc, Sinan Onur and Cavusoglu, Devrim and Sahin, Kadir and Eryuksel, Ogulcan},
  title        = {{SAHI: A lightweight vision library for performing large scale object detection and instance segmentation}},
  month        = nov,
  year         = 2021,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.5718950},
  url          = {https://doi.org/10.5281/zenodo.5718950}
}Contributingsahilibrary currently supports allYOLOv5 models,MMDetection models,Detectron2 models, andHuggingFace object detection models. Moreover, it is easy to add new frameworks.All you need to do is, create a new .py file undersahi/models/folder and create a new class in that .py file that implementsDetectionModel class. You can take theMMDetection wrapperorYOLOv5 wrapperas a reference.Before opening a PR:Install required development packages:pipinstall-e."[dev]"Reformat with black and isort:python-mscripts.run_code_styleformatContributorsFatih Cagatay AkyonSinan Onur AltinucDevrim CavusogluCemil CengizOgulcan EryukselKadir NarBurak MadenPushpak BhogeM. Can V.Christoffer EdlundIshworMehmet EcevitKadir SahinWeyYoungjaeAlzbeta TureckovaWei JiAynur SusuzPranav Durai