Detectron | research platform for object detection research | Computer Vision library

 by   facebookresearch Python Version: Current License: Apache-2.0

kandi X-RAY | Detectron Summary

kandi X-RAY | Detectron Summary

Detectron is a Python library typically used in Telecommunications, Media, Media, Entertainment, Artificial Intelligence, Computer Vision, Deep Learning, Pytorch applications. Detectron has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can download it from GitHub.

The goal of Detectron is to provide a high-quality, high-performance codebase for object detection research. It is designed to be flexible in order to support rapid implementation and evaluation of novel research. Detectron includes implementations of the following object detection algorithms:.

            kandi-support Support

              Detectron has a medium active ecosystem.
              It has 25807 star(s) with 5517 fork(s). There are 953 watchers for this library.
              It had no major release in the last 6 months.
              There are 305 open issues and 619 have been closed. On average issues are closed in 260 days. There are 24 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of Detectron is current.

            kandi-Quality Quality

              Detectron has 0 bugs and 0 code smells.

            kandi-Security Security

              Detectron has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              Detectron code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              Detectron is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              Detectron releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              Detectron saves you 5599 person hours of effort in developing the same functionality from scratch.
              It has 11721 lines of code, 624 functions and 90 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed Detectron and discovered the below as its top functions. This is intended to give you an instant insight into Detectron implemented functionality, and help decide if they suit your requirements.
            • Visualize a single image
            • Return a colormap
            • Convert boxes in cls format
            • Get class string
            • Add RPNR outputs to model
            • Generate Proposal proposals
            • Generate thumbnail anchors
            • Compute retinananet outputs for a model
            • Wrapper for convolution
            • Bottleneck bottleneck transformation
            • Forward prediction
            • Calculate retinanet loss
            • Add keypoint outputs to model
            • Bottleneck bottleneck
            • Convert heatmaps to keypoints
            • Generate a list of processors in parallel
            • Add keypoint blobs to image
            • Add mask and background mask
            • Convert a set of city - scatters
            • Add Retinanet blobs to image
            • Evaluate the exposure of a box
            • Convert a caffe network
            • Check that the expected results are valid
            • Parse command line arguments
            • Add RfcNN outputs to the model
            • Add RPN blobs to RPN
            Get all kandi verified functions for this library.

            Detectron Key Features

            No Key Features are available at this moment for Detectron.

            Detectron Examples and Code Snippets

            Pythondot img1Lines of Code : 17dot img1License : Permissive (MIT)
            copy iconCopy
            # you can use your trained model
            ./ logs/ --img 
            # COCO Example: Mask R-CNN, ResNet50, 31.4 mAP@50:95
            cd examples/coco
            mkdir -p $LOG_DIR
            pip install gdown
            copy iconCopy
            # symlink the coco dataset
            cd ~/github/maskrcnn-benchmark
            mkdir -p datasets/coco
            ln -s /path_to_coco_dataset/annotations datasets/coco/annotations
            ln -s /path_to_coco_dataset/train2014 datasets/coco/train2014
            ln -s /path_to_coco_dataset/test2014 data  
            copy iconCopy
            # symlink the coco dataset
            cd ~/github/maskrcnn-benchmark
            mkdir -p datasets/coco
            ln -s /path_to_coco_dataset/annotations datasets/coco/annotations
            ln -s /path_to_coco_dataset/train2014 datasets/coco/train2014
            ln -s /path_to_coco_dataset/test2014 data  
            tensorpack - eval
            Pythondot img4Lines of Code : 179dot img4License : Non-SPDX (Apache License 2.0)
            copy iconCopy
            # -*- coding: utf-8 -*-
            # File:
            import itertools
            import json
            import numpy as np
            import os
            import sys
            from collections import namedtuple
            from concurrent.futures import ThreadPoolExecutor
            from contextlib import ExitStack
            import cv2
            import pyco  
            tensorpack - model fpn
            Pythondot img5Lines of Code : 151dot img5License : Non-SPDX (Apache License 2.0)
            copy iconCopy
            # -*- coding: utf-8 -*-
            import itertools
            import numpy as np
            import tensorflow as tf
            from tensorpack import tfv1
            from tensorpack.models import Conv2D, FixedUnPooling, MaxPooling, layer_register
            from tensorpack.tfutils.argscope import argscope
            from t  
            tensorpack - config
            Pythondot img6Lines of Code : 21dot img6License : Non-SPDX (Apache License 2.0)
            copy iconCopy
            # -*- coding: utf-8 -*-
            # File:
            import numpy as np
            import os
            import pprint
            import six
            from tensorpack.utils import logger
            from tensorpack.utils.gpu import get_num_gpu
            __all__ = ['config', 'finalize_configs']
            class AttrDict():

            Community Discussions


            Using detectron2 how do I change how many classes my dataset has
            Asked 2022-Feb-15 at 10:42

            Despite changing the classes line to



            Answered 2022-Feb-15 at 10:42

            I figured it out and it was me being dumb

            So let my dumbness provide an answer for anyone else stuck up this particular creek.

            So in addition to adding



            Getting C1001 Internal compiler error when building pytorch on windows
            Asked 2020-Oct-05 at 13:14

            I'm trying to build Pytorch on windows using visual studio, but it seems it faces some internal compiler error which I have not been able to figure out its cause. out of 46 targets, 35 gets built successfully until it ultimately fails with the following errors. Before I list the errors this is how I went about building it :



            Answered 2020-Oct-05 at 12:37

            An Internal compiler error is always a bug with the compiler. In this case, it's prevented building of a library that is needed later in the build process.

            Your options are limited. I suggest trying a different version of Visual Studio.

            You should also report this to Microsoft.



            Cuda version issue while using Detectron2 in Google Colab
            Asked 2020-Jun-12 at 10:40

            I am trying to run the Detectron2 module on Colab using CUDA version 10.0 but since today there have been some issues regarding the versions of Cuda Compiler.

            The output I get after running !nvidia-smi is :



            Answered 2020-Jun-12 at 10:39

            The problem was with the compiled Detectron2 Cuda runtime version and once I recompiled Detectron2 the error was solved.

            Here is the result from !python -m detectron2.utils.collect_env command:



            my own implementation of FastRCNN cannot perform well on balanced data
            Asked 2020-Jun-09 at 06:06


            There are 700 images for training, each of them extract 64 rois and make a mini-batch, when batch-size is set to 2, it cast 350 steps to complete training, but for RCNN, each target is extracted as a single image resized to 224*224, there will be 64*700=44800 images, each of which contains more information and features than a 7*7 pooled feature map and I guess that's why it seems under-fitting though RCNN could be train well on same data.


            Use fully balanced data, and acc drops to 0.53 (training data)



            Answered 2020-Jun-09 at 06:06

            Damn, now I know what problem it is:




            Detectron2 Panoptic FPN Model Partial Execution - TypeError: 'NoneType' object is not iterable
            Asked 2020-Jun-08 at 02:08

            I am trying to extract the pre-output feature-map for the Panoptic Output of Detectron2 ResNet50 - based FPN model.

            Hence, In order to get partial model outputs, I am following the official Detectron2 Modeling Documentation to Partially Execute Models.

            Please find the code below:



            Answered 2020-Jun-08 at 02:08

            With a bit more digging, I solved the issue. There were a couple of problems in the above code:

            1. I did not set the model to eval mode first - model.eval(). The model needs to be set to eval fist.
            2. The mode.proposal_generator() expects inputs in the form of ImageList object, details regarding which can be found here.

            Performing the above two steps solved the issue.


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install Detectron

            Please find installation instructions for Caffe2 and Detectron in


            To start, please check the troubleshooting section of our installation instructions as well as our FAQ. If you couldn't find help there, try searching our GitHub issues. We intend the issues page to be a forum in which the community collectively troubleshoots problems. If bugs are found, we appreciate pull requests (including adding Q&A's to and improving our installation instructions and troubleshooting documents). Please see for more information about contributing to Detectron.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone facebookresearch/Detectron

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link