Skip to content
Branch: master
Find file Copy path
Find file Copy path
6 contributors

Users who have contributed to this file

@hellock @OceanPang @dsuess @michaelisc @liuzili97 @ozps
106 lines (81 sloc) 3.24 KB



We have tested the following versions of OS and softwares:

  • OS: Ubuntu 16.04/18.04 and CentOS 7.2
  • CUDA: 9.0/9.2/10.0
  • NCCL: 2.1.15/2.2.13/2.3.7/2.4.2
  • GCC: 4.9/5.3/5.4/7.3

Install ttfnet

Note that since the ttfnet is based on the mmdetection, the installation pipeline is the same.

a. Create a conda virtual environment and activate it. Then install Cython.

conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab

conda install cython

b. Install PyTorch stable or nightly and torchvision following the official instructions.

c. Clone the ttfnet repository.

git clone
cd ttfnet

d. Install ttfnet (other dependencies will be installed automatically).

python develop
# or "pip install -v -e ."


  1. It is recommended that you run the step e each time you pull some updates from github. If there are some updates of the C/CUDA codes, you also need to run step d. The git commit id will be written to the version number with step e, e.g. 0.6.0+2e7045c. The version will also be saved in trained models.

  2. Following the above instructions, ttfnet is installed on dev mode, any modifications to the code will take effect without installing it again.

Prepare COCO dataset.

It is recommended to symlink the dataset root to $TTFNET/data.

├── mmdet
├── tools
├── configs
├── data
│   ├── coco
│   │   ├── annotations
│   │   ├── train2017
│   │   ├── val2017
│   │   ├── test2017
│   ├── cityscapes
│   │   ├── annotations
│   │   ├── train
│   │   ├── val
│   ├── VOCdevkit
│   │   ├── VOC2007
│   │   ├── VOC2012

The cityscapes annotations have to be converted into the coco format using the cityscapesScripts toolbox. We plan to provide an easy to use conversion script. For the moment we recommend following the instructions provided in the maskrcnn-benchmark toolbox. When using this script all images have to be moved into the same folder. On linux systems this can e.g. be done for the train images with:

cd data/cityscapes/
mv train/*/* train/


Here is a script for setting up mmdetection with conda.


You can run python(3) develop or pip install -v -e . to install ttfnet if you want to make modifications to it frequently.

If there are more than one mmdetection on your machine, and you want to use them alternatively. Please insert the following code to the main file

import os.path as osp
import sys
sys.path.insert(0, osp.join(osp.dirname(osp.abspath(__file__)), '../'))

or run the following command in the terminal of corresponding folder.

You can’t perform that action at this time.