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

dataset adapter #10

Open
ahkarami opened this issue Jul 14, 2018 · 3 comments
Open

dataset adapter #10

ahkarami opened this issue Jul 14, 2018 · 3 comments
Labels
feature New feature

Comments

@ahkarami
Copy link
Contributor

ahkarami commented Jul 14, 2018

Dear @louis-she & @pengbo0054,
In

sfd.pytorch/dataset.py

Lines 97 to 100 in 3f62b17

x[0] * height_scale,
x[1] * width_scale,
x[2] * height_scale,
x[3] * width_scale
, you multiply height scale to x[0] & x[2] and width scale to x[1] & x[3].
However, in the readme of Wider-Face data set mentioned that

The format of txt ground truth is as follows: 
File name
Number of bounding box
x1, y1, w, h, blur, expression, illumination, invalid, occlusion, pos

I mean that, I guess a mistake occur in this part of code. Maybe you should change the dataset.py as follows:

        # scale coordinate
        height, width = image.shape[:2]
        width_scale, height_scale = 640.0 / width, 640.0 / height
        coordinates = np.array(list(map(lambda x: [
            x[0] * width_scale,  # Change this part
            x[1] * height_scale,  # Change this part
            x[2] * width_scale,  # Change this part
            x[3] * height_scale  # Change this part
], coordinates)))

Am I correct?

Just as another note. I suggest that you add a general ListDataset class instead of specific data sets (e.g., Wider-Face, Pascal VOC, etc.). For example the ListDataset class can use data set annotations as follows:

Load image/labels/boxes from a list file (e.g., *.txt file).
The list file is like:
a.jpg xmin ymin xmax ymax label xmin ymin xmax ymax label ...

Thank you

@louis-she
Copy link
Owner

louis-she commented Jul 14, 2018

Hi @ahkarami ,
The coordinates have been converted to top left bottom right at here.
And a more flexible and general Dataset class is considered. We already supported VOC dataset and now we're training on it. If it works, we will refactor dataset.py to adapt for other dataset too.

@louis-she louis-she changed the title Probable Mistake in dataset.py dataset adapter Jul 14, 2018
@louis-she louis-she added the feature New feature label Jul 14, 2018
@ahkarami
Copy link
Contributor Author

ahkarami commented Jul 14, 2018

@louis-she,
Thank you for your response.
Please note that about training on VOC dataset in this state, I think because the aspect_ratio is 1:1 and data augmentation methods don't implement yet, so the obtained result maybe will not be good.
I'll try to help you in near future (I try to find free time for it) via some pull requests, to further strengthen your codes.
Good luck

@louis-she
Copy link
Owner

Thank you @ahkarami really looking forward to your PR : )

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

No branches or pull requests

2 participants