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

how to create local data for training and what is the training label format? #5

Open
learn01one opened this issue Apr 11, 2024 · 1 comment

Comments

@learn01one
Copy link

Hello, how to create local data for training and what is the training label format? , the hlw data cannot be downloaded and the data format cannot be known, thank you

@ebrach
Copy link
Collaborator

ebrach commented Jun 25, 2024

Hi. Sorry to hear that the HLW dataset is not accessible anymore. The request form (linked in our readme) still seems to exist - did you request access?

Anyway, another option to infer the dataset format is to reverse engineer hlw_dataset.py, specifically looking at

for row in metadata:
cur_image = 'hlw/images/' + row[0]
if cur_image in self.images:
idx = self.images.index(cur_image)
cur_labels = torch.zeros((4))
cur_labels[0] = float(row[1])
cur_labels[1] = float(row[2])
cur_labels[2] = float(row[3])
cur_labels[3] = float(row[4])
self.gt[idx] = cur_labels
and
#convert ground truth coordinate system (from zero center to zero corner)
yOffset = image.shape[0] / label_scale / 2 # mind zero padding to make image square
xOffset = image.shape[1] / label_scale / 2
gt = self.gt[idx].clone()
gt /= label_scale
gt[0] += xOffset
gt[1] *= -1
gt[1] += yOffset
gt[2] += xOffset
gt[3] *= -1
gt[3] += yOffset
.

It looks to me like the metadata.csv of the dataset contained one line per image, as img_file, x0, y0, x1, y1. The line coordinates (start and end point) seem to be in px, and relative to the image center. y-direction seems to be from bottom to top.

But all of the above is a guess based on a quick look and has to be tested.

Best,
Eric

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

2 participants