Hongje / OTVM

One-Trimap Video Matting (ECCV 2022)
Other
81 stars 7 forks source link

How should I set the configs during inference #2

Open ccyyatnet opened 2 years ago

ccyyatnet commented 2 years ago

First of all, excellent work! I'd like to know how should i set the configs(especially MEMORY_* stuffs) during inference using my own data? And how should I prepare my own data with first frame trimap given?

Hongje commented 2 years ago

Hi, thank you for your interest in our work! You can try to use the default setting as in config.py for your own data. And you can prepare the trimap through any segmentation annotation tool. We used labelme for real-world examples in the paper (a trimap in the first column, Fig. 4).

ccyyatnet commented 2 years ago

thx for reply~ Should i use STAGE=4 to get best performance? And what do the comments mean after MEMORY_MAX_NUM? _C.TEST.MEMORY_MAX_NUM = 5 # 2: First&Prev, 0: First, 1: Prev, 3~: Multiple

Hongje commented 2 years ago

Should i use STAGE=4 to get best performance?

Yes, since we used the video dataset only in STAGE=4 (and used the image dataset in STAGE=1,2,3), STAGR=4 should be used to get the best performance.

And what do the comments mean after MEMORY_MAX_NUM? _C.TEST.MEMORY_MAX_NUM = 5 # 2: First&Prev, 0: First, 1: Prev, 3~: Multiple

It means that the maximum number of memory frames for STM. Following the original STM, we memorize (1) the first frame, (2) the previous (last) frame, and (3) intermediate frames. Here, the first and previous frames are one frame, respectively. But, intermediate frames can be one~infinite frames. Thus, we limit the number of intermediate frames using this option. if _C.TEST.MEMORY_MAX_NUM = 0, then only the first frame will be memorized if _C.TEST.MEMORY_MAX_NUM = 1, then only the previous frame will be memorized if _C.TEST.MEMORY_MAX_NUM = 0, then only the first and previous frames will be memorized if _C.TEST.MEMORY_MAX_NUM >= 3, then the first and previous frames will be memorized; and the intermediate frames of _C.TEST.MEMORY_MAX_NUM-2 frames will be memorized with _C.TEST.MEMORY_SKIP_FRAME frame interval. If the number of memorized intermediate frames over TEST.MEMORY_MAX_NUM-2, then the old intermediate frames will be discarded.