Juliachang / SC-CAM

SC-CAM: Weakly-Supervised Semantic Segmentation via Sub-category Exploration (CVPR 2020)
MIT License
179 stars 17 forks source link

model output #25

Open SharhadBashar opened 3 years ago

SharhadBashar commented 3 years ago

The model outputs x_20 and y_20 What are these exactly? same for x_200 and y_200

Also x_200 / y_200 has a size of 200 per image. can i assume, the first 10 values are for the first class, the next 10 values for the second class and so on?

Also i set the value for k_cluster in script.sh to 5, but only label_200 came out as size 100 for each image. x_200 and y_200 were still size 200 for each image. Why?

wasidennis commented 3 years ago

y_20 is the output (x_20 is before sigmoid) of 20-category classification, and y_200 is the output of the fine-grained classification, where each parent class contains 10 sub-categories. And yes, the first 10 are for the 1st parent class, and so on.

This line should give you 100 outputs if you set the cluster number as 5, where the model is initiated at this line in train_cls.py.

SharhadBashar commented 3 years ago

I want to modify the images used for training: i want to add my own images. how do i go around doing that? here is what i did:

  1. I added the raw images to the JPEGImages folder
  2. I added the segmented versions to the SegmentationClassAug folder
  3. I added the image paths to train_aug.txt in voc12
  4. I added their labels to train_label.npy
  5. I added their image name and class label to cls_labels.npy in the same format as the other entires
  6. did not need to add them to 20_class_labels.npy, as they were already there I added about 1500 images, extract features extracts all the 12000+ images, but when i run create pseudo label, in the line instead of printing (12000, 200) (12000, 20) it prints (18000, 200) (18000, 20) What am i doing wrong, or am i missing any steps?

Heres the error:

18605 18605
18605 18605 (16458, 20)
Traceback (most recent call last):
  File "create_pseudo_label.py", line 202, in <module>
    train_filename_list, train_label_200, train_label_20 = create_train_data(merge_filename_list, new_label_list, keep_idx_list)
  File "create_pseudo_label.py", line 126, in create_train_data
    train_label_20.append(label_20[idx])
IndexError: index 16460 is out of bounds for axis 0 with size 16458
k_cluster: 10