Closed darrenjkt closed 2 months ago
Adding Debug() in between helped me to check the outputs.
pipeline.add_pre_processing(
[
Debug(),
Resize((1280,1280), layout="HWC", name='resize', policy='not_larger'), # Uses BILINEAR currently
Debug(),
LetterBox(target_shape=(1280, 1280), fill_value=114, name='pad', layout='HWC'),
Debug(),
Normalize([(123.675, 58.395), (116.28, 57.12), (103.53, 57.375)], name='normalize', layout="HWC"), # (mean, stddev) for each channel
Debug(),
ChannelsLastToChannelsFirst(name="RGBImageCHW"), # HWC to CHW
Debug(),
Unsqueeze([0], name='unsqueeze'), # add batch, CHW --> 1CHW
Debug(),
]
)
I can then check the outputs with:
ort_inputs = {ort_session.get_inputs()[0].name: image}
out = ort_session.run(None, ort_inputs)
dets, labels, input_debug, resized_d, pad_d, norm_d, transposed_d, expand_d = out
where dets, labels are my original outputs.
Hi, I have the following preprocessing code that I would like to add to my model. However I would like to first run an image through it and inspect the final output
How can I export this pipeline as an onnx model? Or just simply run a
out = preproc(image)
through this pipeline?