TrackR-CNN(一) 項目及數據集
項目概述
論文:MOTS:Multi-Object Tracking and Segmentation
GIthub源碼:TrackR-CNN
MOTS數據可視化工具Github:MOTS_Tools
項目主頁:https://www.vision.rwth-aachen.de/page/mots
CVPR2020挑戰賽: CVPR2020 Workshop
Github 解析
數據集解析
文件目錄
data/
- KITTI_MOTS/
-- train/
--- images/
---- 0000/
----- 000000.png
----- 000001.png
----- ...
---- 0001/
---- ...
--- instances/
---- 0000/
----- 000000.png
----- 000001.png
----- ...
---- 0001/
---- ...
models/
- conv3d_sep2/
-- conv3d_sep2-00000005.data-00000-of-00001
-- conv3d_sep2-00000005.index
-- conv3d_sep2-00000005.meta
- converted.data-00000-of-00001
- converted.meta
- converted.index
...
main.py
注釋格式
我們提供了兩種替代的等效格式,一種編碼為png圖像,另一種編碼為txt文件。txt文件較小,並且讀取速度更快,但是需要使用cocotools來解碼掩碼。有關讀取注釋的代碼,請參見mots_tools / blob / master /mots_common / io.py
請注意,在兩種格式中,id值10,000都表示忽略區域,而0是背景。類ID可以通過對象ID的下限除以1000(class_id = obj_id // 1000)獲得,實例ID可以通過對象id取余1000(instance_id = obj_id%1000)獲得。對象ID在一段時間內保持一致。
類ID如下 汽車1 行人2
png 格式 instance.png
The png format has a single color channel with 16 bits and can for example be read like this:
import PIL.Image as Image
img = np.array(Image.open("000005.png"))
obj_ids = np.unique(img)
# to correctly interpret the id of a single object
obj_id = obj_ids[0]
class_id = obj_id // 1000
obj_instance_id = obj_id % 1000
When using a TensorFlow input pipeline for reading the annotations, you can use
ann_data = tf.read_file(ann_filename)
ann = tf.image.decode_image(ann_data, dtype=tf.uint16, channels=1)
問題
1、No module named 'pycocotools'
Mask_RCNN需要 coco庫
解決:
clone https://github.com/waleedka/coco
cd coco/PythonAPI
修改makefile
all:
# install pycocotools locally
/home/cnsatm/anaconda3/envs/XCY/bin/python setup.py build_ext --inplace
rm -rf build
install:
# install pycocotools to the Python site-packages
/home/cnsatm/anaconda3/envs/XCY/bin/python setup.py build_ext install
rm -rf build
make
sudo make install
sudo python setup.py install (此步出錯則改為所在anaconda的python)