taki0112 / SPADE-Tensorflow

Simple Tensorflow implementation of "Semantic Image Synthesis with Spatially-Adaptive Normalization" a.k.a. GauGAN, SPADE (CVPR 2019 Oral)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I exclude a label like None(don't care label) during training?

elchem96 opened this issue · comments

It seems that the black color label in the face dataset is segmented as background and the network generates a random background.

Is there a way to exclude this black color label during training for my own dataset? Like, in the official code there is a option for None label. Cause my None label has too different contents I don't want to confuse the network for this label.

안녕하세요. 제가 직접 segmentation을 수행하여 dataset을 만들고 training을 하려고 하는데 제가 None label을 만들어서 검은색으로 마킹을 했는데 training을 할땐 이 label을 제외시키고 트레이닝을 하고싶습니다. None label은 라벨링이 되지 않은 모든 object들이 다 들어있어서 네트워크가 이것 때문에 혼동을 할것 같아서요. 혹시 작성하신 코드 상에서 검은색으로 표기된 label을 제외하고 트레이닝을 할 수 있게 하려면 어떻게 바꿔야할지 알려주실 수 있으신가요?

항상 좋은 코드 감사합니다.

(1) 먼저 이부분 코드가, 주어진 segmentation image의 칼라값에 해당하는 인덱스를 뽑고, 라벨값을 붙이는 코드입니다.
이곳에서 don't care 칼라값에 해당하는 인덱스를 뽑으신후, 라벨을 -1과 같은 의미없는값으로 채우면 될거같습니다.
https://github.com/taki0112/SPADE-Tensorflow/blob/master/utils.py#L246

(2) 그다음 one-hot vector부분을 수정해야할겁니다.
https://github.com/taki0112/SPADE-Tensorflow/blob/master/utils.py#L223
-1에 해당하는것은 의미가 없도록 [0, 0, 0, 0, ...0]으로만 하는식으로 코드를 수정하셔야할겁니다.