Generating post-processed prediction masks with C++ TorchScript #2674
-
Hi, I'm using TorchScript tracing to generate a Mask R-CNN model that I'd like to make use of in a C++ application. It would be wonderful if I could access the post-processed prediction masks that Detectron2 is capable of generating in my application, but I'm not sure what the best way to do that is so I'm looking for advice. As per the deployment docs:
If I use the example deployment code:
I get the expected output which includes the bounding box and the 28x28 mask:
I would like to extend this to include the full size post-processed prediction masks. I was hoping it might be as simple as setting do_postprocess=True at this line: detectron2/tools/deploy/export_model.py Line 86 in 1ba62f1 This generates a model.ts file, but it errors when running the C++ torchscript_traced_mask_rcnn program. Note that I set CUDA_LAUNCH_BLOCKING=1 to try and get a more complete trace:
I'm not sure what the best way is to proceed from here, so any advice would be very welcome. Many thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is not yet supported. The easiest way to get there is for you to call |
Beta Was this translation helpful? Give feedback.
This is not yet supported.
The easiest way to get there is for you to call
cv2.resize
after getting 28x28 mask to resize it to the size of the box