From cbc05f23920e55f8ec36d1fa96eb0e9e2e780cb3 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Tue, 3 Oct 2023 09:19:43 +0900 Subject: [PATCH] fix: segm/bbox combined inference doesn't work well --- impact/subcore.py | 4 ++-- impact/subpack_nodes.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/impact/subcore.py b/impact/subcore.py index 1f2785b..fc25231 100644 --- a/impact/subcore.py +++ b/impact/subcore.py @@ -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) diff --git a/impact/subpack_nodes.py b/impact/subpack_nodes.py index 9742839..256f88a 100644 --- a/impact/subpack_nodes.py +++ b/impact/subpack_nodes.py @@ -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)