Sahi

Latest version: v0.11.16

Safety actively analyzes 642295 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 9 of 15

0.8.2

- fix optional dependencies (221)
- move conda builds to conda-forge (219)

0.8.1

make repo compatible for conda-forge:
- Include requirements.txt in sdist (217) thanks to weiji14

0.8.0

new cli description:
| Command | Description |
|---|---|
| [predict](https://github.com/obss/sahi/blob/main/docs/CLI.md#predict-command-usage) | perform sliced/standard prediction using any [yolov5](https://github.com/ultralytics/yolov5)/[mmdet](https://github.com/open-mmlab/mmdetection) model |
| [predict-fiftyone](https://github.com/obss/sahi/blob/main/docs/CLI.md#predict-fiftyone-command-usage) | perform sliced/standard prediction using any [yolov5](https://github.com/ultralytics/yolov5)/[mmdet](https://github.com/open-mmlab/mmdetection) model and explore results in [fiftyone app](https://github.com/voxel51/fiftyone) |
| [coco slice](https://github.com/obss/sahi/blob/main/docs/CLI.md#coco-slice-command-usage) | automatically slice COCO annotation and image files |
| [coco fiftyone](https://github.com/obss/sahi/blob/main/docs/CLI.md#coco-fiftyone-command-usage) | explore multiple prediction results on your COCO dataset ordered by false positives |
| [coco evaluate](https://github.com/obss/sahi/blob/main/docs/CLI.md#coco-evaluate-command-usage) | evaluate classwise COCO AP and AR for given predictions and ground truth |
| [coco analyse](https://github.com/obss/sahi/blob/main/docs/CLI.md#coco-analyse-command-usage) | calcualate and export many detection and segmentation error margin plots |
| [coco yolov5](https://github.com/obss/sahi/blob/main/docs/CLI.md#coco-yolov5-command-usage) | automatically convert any COCO dataset to [yolov5](https://github.com/ultralytics/yolov5) format |

new cli usage:

predict
bash
sahi predict --source image/file/or/folder --model_path path/to/model --model_config_path path/to/config


predict-fiftyone
bash
sahi predict-fiftyone --image_dir image/file/or/folder --dataset_json_path dataset.json --model_path path/to/model --model_config_path path/to/config


coco slice
bash
sahi coco slice --image_dir dir/to/images --dataset_json_path dataset.json


coco fiftyone
bash
sahi coco fiftyone --image_dir dir/to/images --dataset_json_path dataset.json cocoresult1.json cocoresult2.json


coco evaluate
bash
sahi coco evaluate --dataset_json_path dataset.json --result_json_path result.json


coco analyse
bash
sahi coco analyse --dataset_json_path dataset.json --result_json_path result.json


coco yolov5
bash
sahi coco yolov5 --image_dir dir/to/images --dataset_json_path dataset.json --train_split 0.9


breaking changes in `predict cli`:
- `config_path` to `model_config_path`
- `conf_thresh` to `model_confidence_threshold`
- `match_metric` to `postprocess_match_metric`
- `match_thresh` to `postprocess_match_threshold`
- `class_agnostic` to `postprocess_class_agnostic`
- `pickle` to `export_pickle`, `crop` to `export_crop`
- `novisual` to `export_visual`
- `no_sliced_pred` to `no_sliced_prediction`
- `no_standard_pred` to `no_standard_prediction`
- `coco_file` to `dataset_json_path`

0.7.4

enhancements
- add script for inspecting cocoresults in fiftyone (192)
- create symlinks for mot utils (199)
- handle when iou_thrs is a single float (196)
- Update coco_evaluation.py (197)

bugfix
- fix coco_evaluation script (195)
- fix a typo in object annotation (194)

0.7.3

enhancements
- handle negative bbox coords, utilize image_size param (188)
- add get_upsampled_coco utility to Coco (189)
- add category and negative sample based coco up/sub-sampling (191)

- <big><b>Subsample COCO dataset file:</b></big>

python
from sahi.utils.coco import Coco

specify coco dataset path
coco_path = "coco.json"

init Coco object
coco = Coco.from_coco_dict_or_path(coco_path)

create a Coco object with 1/10 of total images
subsampled_coco = coco.get_subsampled_coco(subsample_ratio=10)

export subsampled COCO dataset
save_json(subsampled_coco.json, "subsampled_coco.json")

bonus: create a Coco object with 1/10 of total images that contain first category
subsampled_coco = coco.get_subsampled_coco(subsample_ratio=10, category_id=0)

bonus2: create a Coco object with negative samples reduced to 1/10
subsampled_coco = coco.get_subsampled_coco(subsample_ratio=10, category_id=-1)


- <big><b>Upsample COCO dataset file:</b></big>

python
from sahi.utils.coco import Coco

specify coco dataset path
coco_path = "coco.json"

init Coco object
coco = Coco.from_coco_dict_or_path(coco_path)

create a Coco object with each sample is repeated 10 times
upsampled_coco = coco.get_upsampled_coco(upsample_ratio=10)

export upsampled COCO dataset
save_json(upsampled_coco.json, "upsampled_coco.json")

bonus: create a Coco object with images that contain first category repeated 10 times
subsampled_coco = coco.get_subsampled_coco(upsample_ratio=10, category_id=0)

bonus2: create a Coco object with negative samples upsampled by 10 times
upsampled_coco = coco.get_upsampled_coco(upsample_ratio=10, category_id=-1)

0.7.2

- add large tiff image reading support (183)
- add concurrent slice export (184)

Page 9 of 15

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.