<jupyter_start><jupyter_text>Use MMDetection with `arcgis.learn`  Introduction MMdetection is an open-source library containing many popular and state-of-the-art object detection models. Through `arcgis.learn` we have provided a bridge to use the growing list of models provided by the MMDetection library.In 2018, the MMdet team won the COCO object detection challenge. Their codebase, which is built with Pytorch, has gradually evolved to include various models and methods. Although the detection task can be complex, the creators of MMDetection decomposed the models into different general components - Backbone, Neck, DenseHead, ROIExtractor, and ROIHead. With this abstraction, the library is able to provide a multitude of single-stage (e.g. GHM, FCOS), two-stage (e.g. Double-Head R-CNN), multi-stage (e.g. Cascade R-CNN), and other detection models. This abstraction-based approach also allows the development of models either by changing the different components or even by adding new ones. Read the MMDetection [paper](https://arxiv.org/pdf/1906.07155.pdf) or checkout its [github repository](https://github.com/open-mmlab/mmdetection), for more details.  Setting up the environment Follow the steps [here](https://developers.arcgis.com/python/guide/install-and-set-up/Install-deep-learning-dependencies) to install deep learning dependencies in ArcGIS Pro or the Anaconda environment respectively.ArcGIS Pro 2.8 users additionally need to install the CUDA toolkit (version 11), mmcv-full, and mmdet libraries. Follow these steps to do so:- Download and install the latest CUDA toolkit version from [here](https://developer.nvidia.com/cuda-downloads).- Add the installed CUDA toolkit's bin folder path (typically, C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin) to the (user or system) Path Environment Variables.- Run the following command in a cloned environment:   `conda install -c esri mmcv-full mmdet`  Implementation in `arcgis.learn` Using MMDetection with arcgis.learn is as simple as using any other object detection model in the library. The only additional step is providing the name of the model to be used when initializing the MMDetection model object.<jupyter_code>model = MMDetection(data, model='dcn')<jupyter_output><empty_output><jupyter_text>The parameters required are:- `data` - the data object prepared using `prepare_data`  - `model` - the name of the models from the list of supported models. The following MMDetection models are supported through `arcgis.learn`:<jupyter_code>MMDetection.supported_models<jupyter_output><empty_output><jupyter_text>The `model` argument can also accept the path to a config file for a variation of one of the supported models. These files can be found [here](https://github.com/open-mmlab/mmdetection/tree/master/configs). The [configs directory](https://github.com/open-mmlab/mmdetection/tree/master/configs) in the mmdetection repository needs to be downloaded for other model variants to work.Additionally, `model_weight` can be provided for these config files. The link to the corresponding weights can be found in the README file for each model.<jupyter_code>cfg = r'C:\mmdetection\configs\atss\atss_r101_fpn_1x_coco.py'
wts = r'C:\mmdetection\atss\atss_r101_fpn_1x_coco\atss_r101_fpn_1x_20200825-dfcadd6f.pth'
model = MMDetection(data, model=cfg, model_weight=wts)<jupyter_output><empty_output><jupyter_text>Training and inference The MMdetection models can be trained using the `fit` method.<jupyter_code>model.fit()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07661860333616059, 'fraction_numerical': 0.011591744416171897, 'mean_word_length': 5.6254681647940075, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '437660', 'license': 'Apache-2.0', 'n_tokens_mistral': 1054, 'n_tokens_neox': 990, 'n_words': 395, 'path': 'guide/14-deep-learning/use_mmdetection_with_arcgis_learn.ipynb', 'repo_name': 'MikeTschudi/arcgis-python-api', 'size': '3537'}