Update controlnet_module.py
Browse files- controlnet_module.py +4 -2
controlnet_module.py
CHANGED
|
@@ -134,12 +134,14 @@ class ControlNetProcessor:
|
|
| 134 |
# 3. Vorbereiten der Eingabe für SAM2
|
| 135 |
# BBox im Format [x_min, y_min, x_max, y_max] erstellen
|
| 136 |
# ACHTUNG: SAM2 erwartet Boxen in diesem Format
|
| 137 |
-
|
|
|
|
|
|
|
| 138 |
|
| 139 |
# Bild mit dem Processor vorverarbeiten
|
| 140 |
inputs = self.sam_processor(
|
| 141 |
image_np,
|
| 142 |
-
input_boxes=
|
| 143 |
return_tensors="pt"
|
| 144 |
).to(self.device)
|
| 145 |
|
|
|
|
| 134 |
# 3. Vorbereiten der Eingabe für SAM2
|
| 135 |
# BBox im Format [x_min, y_min, x_max, y_max] erstellen
|
| 136 |
# ACHTUNG: SAM2 erwartet Boxen in diesem Format
|
| 137 |
+
# Zeilen in der Funktion anpassen:
|
| 138 |
+
|
| 139 |
+
input_boxes = [[[x1, y1, x2, y2]]] #Dreifach verschachtelt
|
| 140 |
|
| 141 |
# Bild mit dem Processor vorverarbeiten
|
| 142 |
inputs = self.sam_processor(
|
| 143 |
image_np,
|
| 144 |
+
input_boxes=input_boxes,
|
| 145 |
return_tensors="pt"
|
| 146 |
).to(self.device)
|
| 147 |
|