.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "build/examples_detection/skip_fintune.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_build_examples_detection_skip_fintune.py: 10. Skip Finetuning by reusing part of pre-trained model =========================================================== There is a dilemma that pre-trained public dataset detection models need finetuning before we can apply them to our interested domain. While it is still a chanllenging task, in this tutorial we showcase a very interesting way to reuse pre-trained models. Basically, you can grab a GluonCV pre-trained detection model and reset classes to a subset of coco categories, and it will be instantly ready to use without any tuning. First let's import some necessary libraries: .. GENERATED FROM PYTHON SOURCE LINES 14-19 .. code-block:: default from matplotlib import pyplot as plt import gluoncv from gluoncv import model_zoo, data, utils .. GENERATED FROM PYTHON SOURCE LINES 20-25 Load a pretrained model ------------------------- Let's get an Faster RCNN model trained on COCO dataset with ResNet-50 backbone. .. GENERATED FROM PYTHON SOURCE LINES 25-28 .. code-block:: default net = model_zoo.get_model('faster_rcnn_resnet50_v1b_coco', pretrained=True) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Downloading /root/.mxnet/models/faster_rcnn_resnet50_v1b_coco-5b4690fb.zip from https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/models/faster_rcnn_resnet50_v1b_coco-5b4690fb.zip... 0%| | 0/123471 [00:00` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: skip_fintune.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_