Skip to content

Releases: obss/sahi

v0.8.2

09 Sep 09:44
731ef6f
Compare
Choose a tag to compare
  • fix optional dependencies (#221)
  • move conda builds to conda-forge (#219)

v0.8.1

08 Sep 11:27
e185def
Compare
Choose a tag to compare

make repo compatible for conda-forge:

  • Include requirements.txt in sdist (#217) thanks to @weiji14

v0.8.0

02 Sep 22:37
aafb579
Compare
Choose a tag to compare

new cli description:

Command Description
predict perform sliced/standard prediction using any yolov5/mmdet model
predict-fiftyone perform sliced/standard prediction using any yolov5/mmdet model and explore results in fiftyone app
coco slice automatically slice COCO annotation and image files
coco fiftyone explore multiple prediction results on your COCO dataset ordered by false positives
coco evaluate evaluate classwise COCO AP and AR for given predictions and ground truth
coco analyse calcualate and export many detection and segmentation error margin plots
coco yolov5 automatically convert any COCO dataset to yolov5 format

new cli usage:

predict

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

predict-fiftyone

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

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

coco fiftyone

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

coco evaluate

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

coco analyse

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

coco yolov5

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

v0.7.4

24 Aug 12:43
cdf86f1
Compare
Choose a tag to compare

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)

v0.7.3

08 Aug 02:13
6d414f7
Compare
Choose a tag to compare

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)

  • Subsample COCO dataset file:

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)
  • Upsample COCO dataset file:
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)

v0.7.2

03 Aug 07:08
5d7526a
Compare
Choose a tag to compare
  • add large tiff image reading support (#183)
  • add concurrent slice export (#184)

v0.7.1

28 Jul 21:21
007dc92
Compare
Choose a tag to compare
  • fix segmentation slicing (#174)

v0.7.0

13 Jul 16:00
03e5191
Compare
Choose a tag to compare
  • refactor predict api (#170)

breaking changes

in predict and predict_fiftyone funtions:

  • replaced model_name arg with model_type
  • replaced model_parameters arg with model_path, model_config_path, model_confidence_threshold, model_device, model_category_mapping, model_category_remapping

in DetectionModel base class:

  • replaced prediction_score_threshold arg with confidence_threshold

updated demo notebooks accordingly

v0.6.2

13 Jul 15:58
9501cd8
Compare
Choose a tag to compare
  • add input size parameter for inference (#169)

Example usages:

detection_model = Yolov5DetectionModel(
    model_path=yolov5_model_path,
    device="cpu", # or 'cuda'
)

result = detection_model.perform_inference(
    image,
    image_size=1280
)

result = get_prediction(
    "demo_data/small-vehicles1.jpeg",
    detection_model,
    image_size=1280
)

result = get_sliced_prediction(
    "demo_data/small-vehicles1.jpeg",
    detection_model,
    image_size=1280,
    slice_height = 256,
    slice_width = 256,
    overlap_height_ratio = 0.2,
    overlap_width_ratio = 0.2
)

v0.6.1

09 Jul 14:49
d0e15c3
Compare
Choose a tag to compare
  • refactor slice_coco script (#165)
  • make default for ignore_negative_samples, False (#166)