Skip to content

Commit

Permalink
using ColonSegNet-07112023-2359.onnx and out720x576.mp4 #34
Browse files Browse the repository at this point in the history
  • Loading branch information
mxochicale committed Nov 10, 2023
1 parent 7c38160 commit ba3d76c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ def compute(self, op_input, op_output, context):
in_message = op_input.receive("in")

# Transpose
tensor = cp.asarray(in_message.get("inference_output_tensor")).get()
tensor = cp.asarray(in_message.get("inference_output_tensor"))
print(f"tensor.min()={cp.min(tensor)}")
print(f"tensor.max()={cp.max(tensor)}")
print(f"tensor.mean()={cp.mean(tensor)}")
print(f"tensor.shape={tensor.shape}")

# Create output message
out_message = Entity(context)
out_message.add(hs.as_tensor(tensor), "out_tensor")
out_message.add(hs.as_tensor(tensor), "inference_output_tensor")
op_output.emit(out_message, "out")


Expand Down Expand Up @@ -80,7 +84,8 @@ def __init__(self, data, source="replayer"):
self.sample_data_path = data

self.model_path_map = {
"ultrasound_seg": os.path.join(self.sample_data_path, "colon.onnx"),
#"ultrasound_seg": os.path.join(self.sample_data_path, "colon.onnx"),
"ultrasound_seg": os.path.join(self.sample_data_path, "ColonSegNet-07112023-2359.onnx"),
}

def compose(self):
Expand Down Expand Up @@ -205,6 +210,7 @@ def compose(self):
self.add_flow(segmentation_preprocessor, segmentation_inference, {("", "receivers")})
self.add_flow(segmentation_inference, info_op, {("transmitter", "in")})
self.add_flow(info_op, segmentation_postprocessor, {("out", "")})
#self.add_flow(segmentation_inference, segmentation_postprocessor, {("transmitter", "")})
self.add_flow(
segmentation_postprocessor,
segmentation_visualizer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# limitations under the License.
---
replayer: # VideoStreamReplayer
basename: "colon_exam_720x576"
#basename: "out720x576"
#basename: "colon_exam_720x576"
basename: "out720x576"
frame_rate: 0 # as specified in timestamps
repeat: true # default: false
realtime: true # default: true
Expand All @@ -40,11 +40,13 @@ segmentation_preprocessor: # FormatConverter
resize_height: 512

segmentation_postprocessor: # Postprocessor
in_tensor_name: out_tensor
in_tensor_name: inference_output_tensor
network_output_type: sigmoid
data_format: nchw

segmentation_visualizer: # Holoviz
height: 512
width: 512
color_lut: [
[0.65, 0.81, 0.89, 0.1],
[0.2, 0.63, 0.17, 0.7],
Expand Down

0 comments on commit ba3d76c

Please sign in to comment.