<jupyter_start><jupyter_text><jupyter_code># You can add more model configs like below.
MODELS_CONFIG = {
    'cascade_tab_net': {
        'config_file': 'configs/faster_rcnn_r50_fpn_1x.py'
    }
}<jupyter_output><empty_output><jupyter_text>Settings<jupyter_code># TODO: change URL to your fork of my repository if necessary.
git_repo_url = 'https://github.com/br-eina/mmdetection_object_detection_demo'

# Pick the model you want to use
# Select a model in `MODELS_CONFIG`.
selected_model = 'cascade_tab_net'  # 'cascade_rcnn_r50_fpn_1x'

# Total training epochs.
total_epochs = 8

# Name of the config file.
config_file = MODELS_CONFIG[selected_model]['config_file']<jupyter_output><empty_output><jupyter_text>Install Open MMLab Detection ToolboxRestart the runtime if there's an issue while importing mmdet<jupyter_code>import os
from os.path import exists, join, basename, splitext

%cd /content
project_name = os.path.abspath(splitext(basename(git_repo_url))[0])
project_name
mmdetection_dir = os.path.join(project_name, "mmdetection")
mmdetection_dir
if not exists(project_name):
    # clone "depth 1" will only get the latest copy of the relevant files.
    !git clone -q --recurse-submodules --depth 1 $git_repo_url
    print("Update mmdetection repo")
    !cd {mmdetection_dir} && git checkout master && git pull
    # dependencies
    !pip install -q mmcv==0.4.3 terminaltables
    # build
    !cd {mmdetection_dir} && python setup.py install
    !pip install -r {os.path.join(mmdetection_dir, "requirements.txt")}
import sys
sys.path.append(mmdetection_dir)
import time
import matplotlib
import matplotlib.pylab as plt
plt.rcParams["axes.grid"] = False<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09982279976373302, 'fraction_numerical': 0.00767867690490254, 'mean_word_length': 5.392452830188679, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '246911', 'license': 'MIT', 'n_tokens_mistral': 606, 'n_tokens_neox': 581, 'n_words': 147, 'path': 'tab_net_finetuning.ipynb', 'repo_name': 'br-eina/mmdetection_object_detection_demo', 'size': '1693'}