Releases: obss/sahi
Releases · obss/sahi
v0.8.3
v0.8.2
v0.8.1
v0.8.0
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
tomodel_config_path
conf_thresh
tomodel_confidence_threshold
match_metric
topostprocess_match_metric
match_thresh
topostprocess_match_threshold
class_agnostic
topostprocess_class_agnostic
pickle
toexport_pickle
,crop
toexport_crop
novisual
toexport_visual
no_sliced_pred
tono_sliced_prediction
no_standard_pred
tono_standard_prediction
coco_file
todataset_json_path
v0.7.4
v0.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)
-
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
v0.7.1
v0.7.0
- refactor predict api (#170)
breaking changes
in predict
and predict_fiftyone
funtions:
- replaced
model_name
arg withmodel_type
- replaced
model_parameters
arg withmodel_path, model_config_path, model_confidence_threshold, model_device, model_category_mapping, model_category_remapping
in DetectionModel base class:
- replaced
prediction_score_threshold
arg withconfidence_threshold
updated demo notebooks accordingly
v0.6.2
- 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
)