fix: segm/bbox combined inference doesn't work well

This commit is contained in:
Dr.Lt.Data
2023-10-03 09:19:43 +09:00
parent 2462c6553b
commit cbc05f2392
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -126,7 +126,7 @@ class UltraBBoxDetector:
return shape, items
def detect_combined(self, image, threshold, dilation):
detected_results = inference_bbox(self.bbox_model, image, threshold)
detected_results = inference_bbox(self.bbox_model, core.tensor2pil(image), threshold)
segmasks = core.create_segmasks(detected_results)
if dilation > 0:
segmasks = core.dilate_masks(segmasks, dilation)
@@ -176,7 +176,7 @@ class UltraSegmDetector:
return shape, items
def detect_combined(self, image, threshold, dilation):
detected_results = inference_bbox(self.bbox_model, image, threshold)
detected_results = inference_segm(self.bbox_model, core.tensor2pil(image), threshold)
segmasks = core.create_segmasks(detected_results)
if dilation > 0:
segmasks = core.dilate_masks(segmasks, dilation)
+1 -1
View File
@@ -3,7 +3,7 @@ import folder_paths
import impact.core as core
import impact.subcore as subcore
print(f"### Loading: ComfyUI-Impact-Pack (Subpack: V0.2.2)")
print(f"### Loading: ComfyUI-Impact-Pack (Subpack: V0.2.3)")
model_path = folder_paths.models_dir
folder_paths.folder_names_and_paths["ultralytics_bbox"] = ([os.path.join(model_path, "ultralytics", "bbox")], folder_paths.supported_pt_extensions)