Conversation
fvisin
left a comment
There was a problem hiding this comment.
Thank you for the PR and sorry for the long time it took me to review it!!
There are a few minor modifications to make, but overall looks good to me. Once you are done with them it can be merged. Thank you!
| shared_path = /data/lisatmp4/dejoieti/data/GATECH/ | ||
|
|
||
| [gta5] | ||
| shared_path = /data/lisatmp4/vazquezd/Datasets/gta5/ |
There was a problem hiding this comment.
Please add the dataset to https://github.com/fvisin/dataset_loaders/blob/master/dataset_loaders/__init__.py as well (both the import and in __all__)
| class GTA5Dataset(ThreadedDataset): | ||
| '''The GTA5 semantic segmentation dataset | ||
|
|
||
| The GTA5 dataset [1] consists of 24966 densely labelled frames split into |
| 10 parts for convenience. The class labels are compatible with the CamVid | ||
| and CityScapes datasets. | ||
|
|
||
| The dataset should be downloaded from [1]_ into the `shared_path` |
|
|
||
| References | ||
| ---------- | ||
| .. [1] https://download.visinf.tu-darmstadt.de/data/from_games/ |
| mean = [0, 0, 0] | ||
| std = [1, 1, 1] | ||
|
|
||
| mapping_type = 'cityscapes' |
There was a problem hiding this comment.
I don't like to have this hardcoded. If having both mappings makes sense please create three classes: a GTA5_abstract class with the common code and two subclasses GTA5_camvid and GTA5_cityscapes that define the relevant attributes.
Unfortunately non_void_nclasses is an attribute of the class and not of the object, so it cannot simply be set in the constructor. It should not be too convoluted to have two classes I hope.
| import scipy.io | ||
| split = scipy.io.loadmat(os.path.join(self.path, 'split.mat')) | ||
| split = split[self.which_set + "Ids"] | ||
| for id in split: |
There was a problem hiding this comment.
id is a built-in function in python. Please replace it with something else (e.g., f or name)
dataset_loaders/images/gta5.py
Outdated
| for id in split: | ||
| filenames.append(str(id[0]).zfill(5)+'.png') | ||
| self._filenames = filenames | ||
| # print(filenames) |
| # cycle through the different videos | ||
| for prefix in prefix_list: | ||
| per_subset_names[prefix] = [el for el in filenames if | ||
| el.startswith(prefix)] |
There was a problem hiding this comment.
Filtering the filenames by the prefix every time get_names is called seems wasteful: why don't you make self.filenames a dictionary and modify the filenames function to store a list of filenames for each prefix?
This should work but please check it:
def filenames(self):
if self._filenames is None:
filenames = {}
split = scipy.io.loadmat(os.path.join(self.path, 'split.mat'))
split = split[self.which_set + "Ids"]
for name in split:
prefix = name[:6]
filenames.setdefault(prefix, []).append(name[0].zfill(5) + '.png')
self._filenames = filenames
return self._filenamesYou can then remove self.prefix_list and the related function, and return self.filenames directly in get_names().
dataset_loaders/images/gta5.py
Outdated
| """ | ||
| from skimage import io | ||
| from PIL import Image | ||
| import numpy as np |
There was a problem hiding this comment.
Move all the imports at the top of the file
| img = io.imread(os.path.join(self.image_path, frame)) | ||
| img = img.astype(floatX) / 255. | ||
|
|
||
| # mask = io.imread(os.path.join(self.mask_path, frame)) |
There was a problem hiding this comment.
remove the commented out line please
|
Hello @david-vazquez! Thanks for updating the PR.
Comment last updated on October 23, 2017 at 21:36 Hours UTC |
|
Thank you again for investigating the issue with the zoom! |
|
Hey @david-vazquez any update on this? :) |
|
@david-vazquez do you have time to work on this? I have a student that could help you closing the PR |
Hi I have added the dataset loader for GTA 5.