Detectron2 is Facebook AI Research (FAIR)’s a next-generation platform for object detection and segmentation.
Detection Algorithms
- Mask R-CNN
- RetinaNet
- Faster R-CNN
- RPN
- Fast R-CNN
- TensorMask
- PointRend
- DensePose etc
Detectron2 Features
- Do an image panoptic segmentation, Densepose, Cascade R-CNN, rotated bounding boxes, PointRend, DeepLab, etc
- Use the pre-trained model as-is for simple projects
- Facebook Research project libraries Deeplab, Densepost, Panoptic-Deeplab, PointRend, PointSup, Rethinking-BatchNorm, TensorMask, TridentNet
Let’s copy existing code from Detectron2 and test the Mask R-CNN detection algorithm.
I am using Google Colab and you check the online code here.
Before you start the blow code on Google Colab, we need to set runtime type as GPU under Runtime -> Change runtime type -> Hardware accelerator -> GPU.
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
tensor([ 0, 0, 0, 0, 55, 0, 0, 55, 45, 48, 0, 0, 0, 39, 39, 25, 25, 39, 39, 0, 0, 60, 41, 0, 44, 0, 39, 39, 54, 39, 55, 54, 0], device='cuda:0') Boxes(tensor([[150.3712, 60.2129, 338.2161, 268.7473], [144.5688, 77.5492, 196.2379, 229.8734], [ 46.2298, 99.3896, 88.3717, 252.4606], [421.1779, 82.4461, 483.4353, 245.6750], [222.2740, 229.0623, 323.1384, 275.3803], [ 97.1342, 189.0907, 164.2664, 253.8456], [ 86.1958, 104.2277, 127.4977, 166.2799], [410.6570, 278.6946, 500.0000, 330.5542], [ 27.5215, 273.6751, 96.3706, 299.4804], [158.6536, 247.7489, 212.3477, 284.0824], [475.8810, 79.7495, 499.9792, 251.6478], [ 21.4694, 131.3979, 49.9615, 164.9136], [182.7235, 90.9372, 223.6169, 193.5774], [399.5022, 152.3770, 409.2560, 183.5939], [382.6896, 153.1429, 392.5776, 183.3090], [ 97.0409, 79.8444, 158.8211, 103.5967], [ 21.5652, 76.1865, 82.8017, 104.4624], [389.9488, 154.5239, 399.2343, 183.3714], [375.4870, 156.4993, 384.8447, 182.8736], [336.0491, 107.6095, 360.7059, 142.0714], [346.2415, 149.1063, 365.0637, 184.3042], [ 6.4078, 239.0749, 425.2805, 331.7826], [267.7467, 292.4175, 295.4471, 331.8892], [374.1860, 112.5420, 390.7335, 138.9254], [285.8362, 260.0081, 300.0565, 296.2886], [322.8302, 156.0329, 347.9706, 205.8926], [407.4373, 164.7340, 413.3133, 183.9582], [366.8717, 161.6679, 375.0180, 183.7057], [334.2393, 269.6788, 359.9655, 286.1754], [401.0000, 166.1669, 408.8109, 183.7229], [ 0.6008, 258.6386, 51.5398, 282.5691], [321.0331, 277.9724, 349.3161, 301.4594], [136.7884, 183.4937, 162.1519, 226.2848]], device='cuda:0'))
Detectron2 Mask R-CNN identifies bowls, dining table, umbrella, person, spoons, cake, etc.
What is your thought on this Detectron2 Facebook AI Research library?
Would you please comment below?
Links:
Further Reading
Posts on Artificial Intelligence, Deep Learning, Machine Learning, and Design Thinking articles:
Rasa X Open Source Conversational AI UI Walk-through
Artificial Intelligence Chatbot Using Neural Network and Natural Language Processing
Leave A Comment