Skip to content

Latest commit

 

History

History
 
 

tools

This directory contains a few useful example scripts for detrex.

  • train_net.py

A simpler training engine modified from lazyconfig_train_net.py.

  • analyze_model.py

Analyze FLOPs, parameters, activations of the detrex model modified from detectron2 analyze_model.py.

  • benchmark.py

Benchmark the training speed, inference speed or data loading speed of a given config, modified from benchmark.py

Usage:

python tools/benchmark.py --config-file /path/to/config.py --task train/eval/data
  • visualize_json_results.py

Visualize the json instance detection/segmentation results dumped by COCOEvaluator modified from visualize_json_results.py

Usage:

python tools/visualize_json_results.py --input x.json \
                                       --output dir/ \
                                       --dataset coco_2017_val

If not using a builtin dataset, you'll need your own script or modify this script.

  • visualize_data.py

Visualize ground truth raw annotations or training data (after preprocessing/augmentations) modified from visualize_data.py

Usage:

python tools/visualize_data.py --config-file /path/to/config.py \
                               --source annotation/dataloader \
                               --output-dir dir/ \
                               [--show]

Notes: the script does not stop by itself when using --source dataloader because a training dataloader is usually infinite.