Update canny_block.py
Browse files- canny_block.py +4 -8
canny_block.py
CHANGED
|
@@ -17,11 +17,7 @@ import numpy as np
|
|
| 17 |
class CannyBlock(ModularPipelineBlocks):
|
| 18 |
@property
|
| 19 |
def expected_components(self):
|
| 20 |
-
return [
|
| 21 |
-
ComponentSpec(
|
| 22 |
-
name="canny_annotator", type_hint=CannyDetector, default_creation_method="init"
|
| 23 |
-
),
|
| 24 |
-
]
|
| 25 |
|
| 26 |
@property
|
| 27 |
def inputs(self) -> List[InputParam]:
|
|
@@ -62,8 +58,9 @@ class CannyBlock(ModularPipelineBlocks):
|
|
| 62 |
)
|
| 63 |
]
|
| 64 |
|
| 65 |
-
def compute_canny(self,
|
| 66 |
-
|
|
|
|
| 67 |
input_image=image,
|
| 68 |
low_threshold=low_threshold,
|
| 69 |
high_threshold=high_threshold,
|
|
@@ -77,7 +74,6 @@ class CannyBlock(ModularPipelineBlocks):
|
|
| 77 |
block_state = self.get_block_state(state)
|
| 78 |
|
| 79 |
block_state.control_image = self.compute_canny(
|
| 80 |
-
components,
|
| 81 |
block_state.image,
|
| 82 |
block_state.low_threshold,
|
| 83 |
block_state.high_threshold,
|
|
|
|
| 17 |
class CannyBlock(ModularPipelineBlocks):
|
| 18 |
@property
|
| 19 |
def expected_components(self):
|
| 20 |
+
return []
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
@property
|
| 23 |
def inputs(self) -> List[InputParam]:
|
|
|
|
| 58 |
)
|
| 59 |
]
|
| 60 |
|
| 61 |
+
def compute_canny(self, image, low_threshold, high_threshold, detect_resolution, image_resolution):
|
| 62 |
+
canny_detector = CannyDetector()
|
| 63 |
+
canny_map = canny_detector(
|
| 64 |
input_image=image,
|
| 65 |
low_threshold=low_threshold,
|
| 66 |
high_threshold=high_threshold,
|
|
|
|
| 74 |
block_state = self.get_block_state(state)
|
| 75 |
|
| 76 |
block_state.control_image = self.compute_canny(
|
|
|
|
| 77 |
block_state.image,
|
| 78 |
block_state.low_threshold,
|
| 79 |
block_state.high_threshold,
|