Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Did you use samples with no parking slots for training? #2

Open
JiangStein opened this issue Oct 8, 2020 · 2 comments
Open

Did you use samples with no parking slots for training? #2

JiangStein opened this issue Oct 8, 2020 · 2 comments

Comments

@JiangStein
Copy link

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!

@yebin999
Copy link

yebin999 commented Nov 2, 2021

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!

@yjyjy131
Copy link

yjyjy131 commented Jun 20, 2022

@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) .. 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants