Skip to content

dataset adapter #10

@ahkarami

Description

@ahkarami

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions