kandi background
Explore Kits

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

 by   facebookresearch Python Version: Current License: Apache-2.0

 by   facebookresearch Python Version: Current License: Apache-2.0

Download this library from

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:.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • Detectron has a medium active ecosystem.
  • It has 24601 star(s) with 5351 fork(s). There are 985 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 301 open issues and 612 have been closed. On average issues are closed in 40 days. There are 22 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of Detectron is current.
Detectron Support
Best in #Computer Vision
Average in #Computer Vision
Detectron Support
Best in #Computer Vision
Average in #Computer Vision

quality kandi Quality

  • Detectron has 0 bugs and 0 code smells.
Detectron Quality
Best in #Computer Vision
Average in #Computer Vision
Detectron Quality
Best in #Computer Vision
Average in #Computer Vision

securitySecurity

  • 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.
Detectron Security
Best in #Computer Vision
Average in #Computer Vision
Detectron Security
Best in #Computer Vision
Average in #Computer Vision

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.
Detectron License
Best in #Computer Vision
Average in #Computer Vision
Detectron License
Best in #Computer Vision
Average in #Computer Vision

buildReuse

  • 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.
Detectron Reuse
Best in #Computer Vision
Average in #Computer Vision
Detectron Reuse
Best in #Computer Vision
Average in #Computer Vision
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.

  • Add retinananet outputs to model .
  • Get the rpn blobs in the image
  • Visualize an image .
  • Add FPN levels to the model .
  • Calculate the vocab for each detection .
  • Add RPN outputs to model .
  • Convert a list of cityscapes .
  • Compute retinanet blobs
  • Add RETINANET .
  • r Evaluate box products for a given roidb dataset .

Detectron Key Features

Mask R-CNN -- Marr Prize at ICCV 2017

RetinaNet -- Best Student Paper Award at ICCV 2017

Faster R-CNN

RPN

Fast R-CNN

R-FCN

ResNeXt{50,101,152}

ResNet{50,101,152}

Feature Pyramid Networks (with ResNet/ResNeXt)

VGG16

Citing Detectron

copy iconCopydownload iconDownload
@misc{Detectron2018,
  author =       {Ross Girshick and Ilija Radosavovic and Georgia Gkioxari and
                  Piotr Doll\'{a}r and Kaiming He},
  title =        {Detectron},
  howpublished = {\url{https://github.com/facebookresearch/detectron}},
  year =         {2018}
}

Using detectron2 how do I change how many classes my dataset has

copy iconCopydownload iconDownload
cfg.MODEL.ROI_HEADS.NUM_CLASSES = 2
MetadataCatalog.get("my_dataset").thing_classes=thing_list
MetadataCatalog.get("my_dataset").set(thing_classes=thing_list)
-----------------------
cfg.MODEL.ROI_HEADS.NUM_CLASSES = 2
MetadataCatalog.get("my_dataset").thing_classes=thing_list
MetadataCatalog.get("my_dataset").set(thing_classes=thing_list)
-----------------------
cfg.MODEL.ROI_HEADS.NUM_CLASSES = 2
MetadataCatalog.get("my_dataset").thing_classes=thing_list
MetadataCatalog.get("my_dataset").set(thing_classes=thing_list)

Cuda version issue while using Detectron2 in Google Colab

copy iconCopydownload iconDownload
----------------------  ----------------------------------------------------------------------------
sys.platform            linux
Python                  3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0]
numpy                   1.18.5
detectron2              0.1.3 @/content/gdrive/My Drive/Data/Table_Struct/detectron2_repo/detectron2
Compiler                GCC 7.5
CUDA compiler           CUDA 10.0
detectron2 arch flags   sm_75
DETECTRON2_ENV_MODULE   <not set>
PyTorch                 1.4.0+cu100 @/usr/local/lib/python3.6/dist-packages/torch
PyTorch debug build     False
GPU available           True
GPU 0                   Tesla T4
CUDA_HOME               /usr/local/cuda
Pillow                  7.0.0
torchvision             0.5.0+cu100 @/usr/local/lib/python3.6/dist-packages/torchvision
torchvision arch flags  sm_35, sm_50, sm_60, sm_70, sm_75
fvcore                  0.1.1
cv2                     4.1.2
----------------------  ----------------------------------------------------------------------------
PyTorch built with:
  - GCC 7.3
  - Intel(R) Math Kernel Library Version 2019.0.4 Product Build 20190411 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v0.21.1 (Git Hash 7d2fd500bc78936d1d648ca713b901012f470dbc)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CUDA Runtime 10.0
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_37,code=compute_37
  - CuDNN 7.6.3
  - Magma 2.5.1
  - Build settings: BLAS=MKL, BUILD_NAMEDTENSOR=OFF, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -O2 -fPIC -Wno-narrowing -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Wno-stringop-overflow, DISABLE_NUMA=1, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_STATIC_DISPATCH=OFF, 

my own implementation of FastRCNN cannot perform well on balanced data

copy iconCopydownload iconDownload
 def call(self, x, mask=None):
        assert (len(x) == 2)
        # x[0] is image with shape (rows, cols, channels)
        img = x[0]
        # x[1] is roi with shape (num_rois,4) with ordering (x1,y1,x2,y2)
        rois = x[1]

        input_shape = img.shape

        outputs = []

        x1 = rois[:, :, 0]
        y1 = rois[:, :, 1]
        x2 = rois[:, :, 2]
        y2 = rois[:, :, 3]
def call(self, x, mask=None):
        assert (len(x) == 2)

        # x[0] is image with shape (rows, cols, channels)
        img = x[0]

        # x[1] is roi with shape (num_rois,4) with ordering (x,y,w,h)
        rois = x[1]

        input_shape = img.shape

        outputs = []

        for roi_idx in range(self.num_rois):
            x1 = rois[0, roi_idx, 0]
            y1 = rois[0, roi_idx, 1]
            x2 = rois[0, roi_idx, 2]
            y2 = rois[0, roi_idx, 3]
-----------------------
 def call(self, x, mask=None):
        assert (len(x) == 2)
        # x[0] is image with shape (rows, cols, channels)
        img = x[0]
        # x[1] is roi with shape (num_rois,4) with ordering (x1,y1,x2,y2)
        rois = x[1]

        input_shape = img.shape

        outputs = []

        x1 = rois[:, :, 0]
        y1 = rois[:, :, 1]
        x2 = rois[:, :, 2]
        y2 = rois[:, :, 3]
def call(self, x, mask=None):
        assert (len(x) == 2)

        # x[0] is image with shape (rows, cols, channels)
        img = x[0]

        # x[1] is roi with shape (num_rois,4) with ordering (x,y,w,h)
        rois = x[1]

        input_shape = img.shape

        outputs = []

        for roi_idx in range(self.num_rois):
            x1 = rois[0, roi_idx, 0]
            y1 = rois[0, roi_idx, 1]
            x2 = rois[0, roi_idx, 2]
            y2 = rois[0, roi_idx, 3]

Community Discussions

Trending Discussions on Detectron
  • Using detectron2 how do I change how many classes my dataset has
  • Getting C1001 Internal compiler error when building pytorch on windows
  • Cuda version issue while using Detectron2 in Google Colab
  • my own implementation of FastRCNN cannot perform well on balanced data
  • Detectron2 Panoptic FPN Model Partial Execution - TypeError: 'NoneType' object is not iterable
Trending Discussions on Detectron

QUESTION

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

cfg.MODEL.ROI_HEADS.NUM_CLASSES = 2

in the config portion of my detectron2 training python script I keep getting back

Got an invalid category_id=1 for a dataset of 1 classes

Is there something special I need to be doing to the dataset itself to let detectron know I have more than one class?

I also tried

cfg.MODEL.SEM_SEG_HEAD.NUM_CLASSES = 2
cfg.MODEL.RETINANET.NUM_CLASSES = 2

Just in case but im using the mask_rcnn_R_101_FPN_3x model so I think the first one is the one that should be doing the trick

I also, also tried importing my class id #'s to the thing_dataset_id_to_contiguous_id metadeta attribute

edit: I've tried a few other models with the same error, which triggers when I call

trainer = DefaultTrainer(cfg)

Ive also printed out my (at the moment very simple because im still just prototyping) dataset dict and cant see anything glaringly obvious.

I cant find anywhere besides the config portion that it even seems to care about the number of classes

edit 2: Installed an instance of ubuntu through wsl and tried running the script and same error

edit 3: tried a python 3.8 and 3.9 venv

ANSWER

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

cfg.MODEL.ROI_HEADS.NUM_CLASSES = 2

into your config section, Detectron also uses your metadata to count how many classes the set should have

I was using

MetadataCatalog.get("my_dataset").thing_classes=thing_list

for some reason thinking I was getting a reference to an object and setting an attribute (and didnt get an error telling me otherwise)

when what I SHOULD have been using was

MetadataCatalog.get("my_dataset").set(thing_classes=thing_list)

I'm not sure where I crossed my wires but at this point it seems to be working

Source https://stackoverflow.com/questions/71108095

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

Vulnerabilities

No vulnerabilities reported

Install Detectron

Please find installation instructions for Caffe2 and Detectron in INSTALL.md.

Support

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 FAQ.md and improving our installation instructions and troubleshooting documents). Please see CONTRIBUTING.md for more information about contributing to Detectron.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Share this Page

share link
Reuse Pre-built Kits with Detectron
Compare Computer Vision Libraries with Highest Support
Compare Computer Vision Libraries with Highest Security
Compare Computer Vision Libraries with Permissive License
Compare Computer Vision Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.