File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -713,6 +713,7 @@ def plot_images(
713713 on_plot = None ,
714714 max_subplots = 16 ,
715715 save = True ,
716+ conf_thres = 0.25 ,
716717):
717718 """Plot image grid with labels."""
718719 if isinstance (images , torch .Tensor ):
@@ -778,7 +779,7 @@ def plot_images(
778779 c = classes [j ]
779780 color = colors (c )
780781 c = names .get (c , c ) if names else c
781- if labels or conf [j ] > 0.25 : # 0.25 conf thresh
782+ if labels or conf [j ] > conf_thres :
782783 label = f"{ c } " if labels else f"{ c } { conf [j ]:.1f} "
783784 annotator .box_label (box , label , color = color , rotated = is_obb )
784785
@@ -800,7 +801,7 @@ def plot_images(
800801 kpts_ [..., 0 ] += x
801802 kpts_ [..., 1 ] += y
802803 for j in range (len (kpts_ )):
803- if labels or conf [j ] > 0.25 : # 0.25 conf thresh
804+ if labels or conf [j ] > conf_thres :
804805 annotator .kpts (kpts_ [j ])
805806
806807 # Plot masks
@@ -816,7 +817,7 @@ def plot_images(
816817
817818 im = np .asarray (annotator .im ).copy ()
818819 for j in range (len (image_masks )):
819- if labels or conf [j ] > 0.25 : # 0.25 conf thresh
820+ if labels or conf [j ] > conf_thres :
820821 color = colors (classes [j ])
821822 mh , mw = image_masks [j ].shape
822823 if mh != h or mw != w :
You can’t perform that action at this time.
0 commit comments