Commit 9320c73 1 parent 1240bab commit 9320c73 Copy full SHA for 9320c73
File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -69,3 +69,31 @@ result = predict(
69
69
)
70
70
71
71
```
72
+
73
+ - Exclude custom classes on inference:
74
+
75
+ ``` python
76
+ from sahi.predict import get_sliced_prediction
77
+ from sahi import AutoDetectionModel
78
+
79
+ # init a model
80
+ detection_model = AutoDetectionModel.from_pretrained(... )
81
+
82
+ # define the class names to exclude from custom model inference
83
+ exclude_classes_by_name = [" car" ]
84
+
85
+ # or exclude classes by its custom id
86
+ exclude_classes_by_id = [0 ]
87
+
88
+ result = get_sliced_prediction(
89
+ image,
90
+ detection_model,
91
+ slice_height = 256 ,
92
+ slice_width = 256 ,
93
+ overlap_height_ratio = 0.2 ,
94
+ overlap_width_ratio = 0.2 ,
95
+ exclude_classes_by_name = exclude_classes_by_name
96
+ # exclude_classes_by_id = exclude_classes_by_id
97
+ )
98
+
99
+ ```
You can’t perform that action at this time.
0 commit comments