MCPcopy Index your code
hub / github.com/Kazuhito00/YOLOX-Colaboratory-Training-Sample

github.com/Kazuhito00/YOLOX-Colaboratory-Training-Sample @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
46 symbols 109 edges 12 files 0 documented · 0% updated 3y ago★ 52
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

[Japanese/English]

YOLOX-Colaboratory-Training-Sample

This is a sample to train YOLOX on Google Colaboratory and export a file in ONNX format and TensorFlow-Lite format.

It includes the following contents.

  • Data set(Annotation not implemented)
  • Data set(Annotated)
  • Colaboratory script (environment setting, model training)
  • ONNX inference sample

Requirement

  • Pytorch 1.9.0 or later
  • apex 0.1 or later
  • pycocotools 2.0 or later
  • OpenCV 3.4.2 or later
  • onnxruntime 1.5.2 or later ※Only when performing inference samples

About annotation

It is assumed that annotation data is annotated using VoTT and output in Pascal VOC format.

However, it is further converted to MS COCO format in the notebook.

The notebook sample assumes the following directory structure.

However, since "pascal_label_map.pbtxt" is not used in this sample,

There is no problem even if you do not store it.

02.annotation_data
│  000001.jpg
│  000001.xml
│  000002.jpg
│  000002.xml
│   :
│  000049.jpg
│  000049.xml
│  000050.xml
└─ pascal_label_map.pbtxt

Usage

Open In Colab

Training will be conducted on Google Colaboratory.

Open your notebook from the [Open In Colab] link and run it in the following order: 1. YOLOX 依存パッケージインストール(YOLOX Dependent Package Install) 1. NVIDIA APEXインストール(NVIDIA APEX Install) 1. PyCocoToolsインストール(PyCocoTools Install) 1. データセットダウンロード(Download Dataset)

If you want to use your own dataset, set "use_sample_image = True" to False and specify the path of your own dataset in

"dataset_directory". 1. Pascal VOC形式 を MS COCO形式へ変換(Convert Pascal VOC format to MS COCO format) 1. モデル訓練(Training Model)

Please store "ano.py" in the "YOLOX" directory before executing "!python train.py".

When using your own data set, change the following items in "nanodet-m.yml". 1. Number of classes

self.num_classes 1. Image storage path

self.data_dir 1. Training data annotation file

self.train_ann 1. Validation data annotation file

self.val_ann 1. Number of epochs

self.max_epoch 1. 推論テスト(Inference test) 1. ONNX変換(Convert to ONNX)

※The original file of "nano.py" is stored in "Megvii-BaseDetection/YOLOX/exps/default"

Author

Kazuhito Takahashi(https://twitter.com/KzhtTkhs)

License

YOLOX-Colaboratory-Training-Sample is under Apache-2.0 License.

Core symbols most depended-on inside this repo

draw_debug
called by 2
sample_tflite.py
draw_debug
called by 2
sample_onnx.py
inference
called by 2
yolox/yolox_tflite.py
_nms
called by 2
yolox/yolox_tflite.py
inference
called by 2
yolox/yolox_onnx.py
_nms
called by 2
yolox/yolox_onnx.py
get_args
called by 1
sample_tflite.py
main
called by 1
sample_tflite.py

Shape

Method 30
Class 10
Function 6

Languages

Python100%

Modules by API surface

yolox/yolox_tflite.py9 symbols
yolox/yolox_onnx.py9 symbols
03.config/nano.py4 symbols
03.config/default/yolov3.py4 symbols
03.config/default/nano.py4 symbols
sample_tflite.py3 symbols
sample_onnx.py3 symbols
03.config/default/yolox_x.py2 symbols
03.config/default/yolox_tiny.py2 symbols
03.config/default/yolox_s.py2 symbols
03.config/default/yolox_m.py2 symbols
03.config/default/yolox_l.py2 symbols

For agents

$ claude mcp add YOLOX-Colaboratory-Training-Sample \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact