SPFCN-ParkingSlotDetection icon indicating copy to clipboard operation
SPFCN-ParkingSlotDetection copied to clipboard

Did you use samples with no parking slots for training?

Open JiangStein opened this issue 5 years ago • 2 comments

Hi, I am trying to apply SPFCN to my own dataset, and I found that only samples with parking slots are loaded to dataloader. `class VisionParkingSlotDataset(Dataset): def init(self, image_path, label_path, data_size, resolution): self.length = data_size self.image_list = [] self.label_list = [] index = 0 for item_name in os.listdir(image_path): item_label = loadmat("%s%s.mat" % (label_path, item_name[:-4])) slots = item_label['slots'] if len(slots) > 0: item_image = cv2.resize(cv2.imread(image_path + item_name), (resolution, resolution)) item_image = np.transpose(item_image, (2, 0, 1)) self.image_list.append(item_image)

            marks = item_label['marks']
            mark_label = self._get_mark_label(marks, slots, resolution)
            slot_label = np.zeros([3, resolution, resolution])
            for mark in mark_label:
                slot_label[0, mark[1] - 3:mark[1] + 4, mark[0] - 3:mark[0] + 4] += GAUSSIAN_VALUE
                slot_label[1, mark[1] - 3:mark[1] + 4, mark[0] - 3:mark[0] + 4] += mark[2]
                slot_label[2, mark[1] - 3:mark[1] + 4, mark[0] - 3:mark[0] + 4] += mark[3]
            self.label_list.append(slot_label)

            index += 1
            if index == data_size:
                break`

Since there are many images with no parking slots in my own dataset, I want to know whether the accuracy written in paper were calculated by using this dataset? Or did you compare the effect of dataset with and without parking slots? Thank you!

JiangStein avatar Oct 08 '20 02:10 JiangStein

hi, when you training your own dataset, have you ever encountered this warning: Could not initialize NNPACK! Reason: Unsupported hardware. ? and i meet this error :RuntimeError: Expected object of scalar type Byte but got scalar type Float for argument #3 'mat1' in call to th_addmm Thanks!

yebin999 avatar Nov 02 '21 08:11 yebin999

@JiangStein I guess the author didn't consider the empty slot sample. In this paper, if the parking slot has less than two entrance points, there are no mark coordiations generated. The reason is because gt says it doesn't have any slots in this case. Also in the code, it is not used for learning because gt value is converted into the mark heatmap only when there is (exist) a slot. It corresponds to the following part of the code : ./SPFCN/dataset.py - class VisionParkingSlotDataset

if len(slots) > 0:
            item_image = cv2.resize(cv2.imread(image_path + item_name), (resolution, resolution))
            item_image = np.transpose(item_image, (2, 0, 1))
            self.image_list.append(item_image) .. 

yjyjy131 avatar Jun 20 '22 03:06 yjyjy131