update doc tool
@@ -109,4 +109,50 @@ CUDA_VISIBLE_DEVICES=4,5,6,7 GPUS=4 ./tools/slurm_train.sh ${PARTITION} ${JOB_NA
## Useful tools
-[TODO]
+We provide lots of useful tools under `tools/` directory.
+
+### Get the FLOPs and params (experimental)
+
+We provide a script adapted from [flops-counter.pytorch](https://github.com/sovrasov/flops-counter.pytorch) to compute the FLOPs and params of a given model.
+
+```shell
+python tools/get_flops.py ${CONFIG_FILE} [--shape ${INPUT_SHAPE}]
+```
+
+For example,
+```shell
+python tools/get_flops.py configs/resotorer/srresnet.py --shape 40 40
+```
+You will get the result like this.
+
+```
+==============================
+Input shape: (3, 40, 40)
+Flops: 4.07 GMac
+Params: 1.52 M
+==============================
+```
+
+**Note**: This tool is still experimental and we do not guarantee that the number is correct. You may well use the result for simple comparisons, but double check it before you adopt it in technical reports or papers.
+
+(1) FLOPs are related to the input shape while parameters are not. The default input shape is (1, 3, 250, 250).
+(2) Some operators are not counted into FLOPs like GN and custom operators.
+You can add support for new operators by modifying [`mmedit/utils/flops_counter.py`](https://github.com/open-mmlab/mmediting/blob/master/mmedit/utils/flops_counter.py).
+
+### Publish a model
+
+Before you upload a model to AWS, you may want to
+(1) convert model weights to CPU tensors, (2) delete the optimizer states and
+(3) compute the hash of the checkpoint file and append the hash id to the filename.
+
+```shell
+python tools/publish_model.py ${INPUT_FILENAME} ${OUTPUT_FILENAME}
+```
+
+E.g.,
+
+```shell
+python tools/publish_model.py work_dirs/example_exp/latest.pth example_model_20200202.pth
+```
+
+The final output filename will be `example_model_20200202-{hash id}.pth`.
