scene_graph_benchmark/demo
pzzhang 462a68f3e1 upgrade repo to pytorch1.7 & add transformer based backbone 2021-06-28 17:46:49 -07:00
..
1024px-Gen_Robert_E_Lee_on_Traveler_at_Gettysburg_Pa.jpg add scene graph benchmark code 2021-04-12 22:08:44 -07:00
Mask_R-CNN_demo.ipynb original maskrcnn-benchmark 2021-02-01 17:47:36 -08:00
R152FPN_demo.png add scene graph benchmark code 2021-04-12 22:08:44 -07:00
README.md original maskrcnn-benchmark 2021-02-01 17:47:36 -08:00
demo_e2e_mask_rcnn_R_50_FPN_1x.png original maskrcnn-benchmark 2021-02-01 17:47:36 -08:00
demo_e2e_mask_rcnn_X_101_32x8d_FPN_1x.png original maskrcnn-benchmark 2021-02-01 17:47:36 -08:00
panoptic_segmentation_shapes_dataset_demo.ipynb original maskrcnn-benchmark 2021-02-01 17:47:36 -08:00
predictor.py upgrade repo to pytorch1.7 & add transformer based backbone 2021-06-28 17:46:49 -07:00
shapes_dataset_demo.ipynb original maskrcnn-benchmark 2021-02-01 17:47:36 -08:00
shapes_pruning.ipynb original maskrcnn-benchmark 2021-02-01 17:47:36 -08:00
webcam.py original maskrcnn-benchmark 2021-02-01 17:47:36 -08:00
woman_fish.jpg upgrade repo to pytorch1.7 & add transformer based backbone 2021-06-28 17:46:49 -07:00

README.md

Webcam and Jupyter notebook demo

This folder contains a simple webcam demo that illustrates how you can use maskrcnn_benchmark for inference.

With your preferred environment

You can start it by running it from this folder, using one of the following commands:

# by default, it runs on the GPU
# for best results, use min-image-size 800
python webcam.py --min-image-size 800
# can also run it on the CPU
python webcam.py --min-image-size 300 MODEL.DEVICE cpu
# or change the model that you want to use
python webcam.py --config-file ../configs/caffe2/e2e_mask_rcnn_R_101_FPN_1x_caffe2.yaml --min-image-size 300 MODEL.DEVICE cpu
# in order to see the probability heatmaps, pass --show-mask-heatmaps
python webcam.py --min-image-size 300 --show-mask-heatmaps MODEL.DEVICE cpu

With Docker

Build the image with the tag maskrcnn-benchmark (check INSTALL.md for instructions)

Adjust permissions of the X server host (be careful with this step, refer to here for alternatives)

xhost +

Then run a container with the demo:

docker run --rm -it \
    -e DISPLAY=${DISPLAY} \
    --privileged \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    --device=/dev/video0:/dev/video0 \
    --ipc=host maskrcnn-benchmark \
    python demo/webcam.py --min-image-size 300 \
    --config-file configs/caffe2/e2e_mask_rcnn_R_50_FPN_1x_caffe2.yaml

DISCLAIMER: This was tested for an Ubuntu 16.04 machine, the volume mapping may vary depending on your platform