Skip to content

Commit f83e9f8

Browse files
authored
update predict verbose (#317)
1 parent e04da2a commit f83e9f8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sahi/predict.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ def predict(
358358
Can be specified as 'jpg' or 'png'
359359
verbose: int
360360
0: no print
361-
1: print slice/prediction durations, number of slices, model loading/file exporting durations
361+
1: print slice/prediction durations, number of slices
362+
2: print model loading/file exporting durations
362363
"""
363364
# assert prediction type
364365
assert (
@@ -441,7 +442,7 @@ def predict(
441442
postprocess_match_metric=postprocess_match_metric,
442443
postprocess_match_threshold=postprocess_match_threshold,
443444
postprocess_class_agnostic=postprocess_class_agnostic,
444-
verbose=verbose,
445+
verbose=1 if verbose else 0,
445446
)
446447
object_prediction_list = prediction_result.object_prediction_list
447448
durations_in_seconds["slice"] += prediction_result.durations_in_seconds["slice"]
@@ -544,7 +545,7 @@ def predict(
544545
save_json(coco_json, save_path)
545546

546547
# print prediction duration
547-
if verbose == 1:
548+
if verbose == 2:
548549
print(
549550
"Model loaded in",
550551
durations_in_seconds["model_load"],

0 commit comments

Comments
 (0)