{"action":"closed","issue":{"url":"https://api.github.com/repos/NVIDIA/DALI/issues/274","repository_url":"https://api.github.com/repos/NVIDIA/DALI","labels_url":"https://api.github.com/repos/NVIDIA/DALI/issues/274/labels{/name}","comments_url":"https://api.github.com/repos/NVIDIA/DALI/issues/274/comments","events_url":"https://api.github.com/repos/NVIDIA/DALI/issues/274/events","html_url":"https://github.com/NVIDIA/DALI/issues/274","id":377882626,"node_id":"MDU6SXNzdWUzNzc4ODI2MjY=","number":274,"title":"FileReader: how to get (image, image) pairs rather than (image, label) pairs?","user":{"login":"opetrova","id":22214928,"node_id":"MDQ6VXNlcjIyMjE0OTI4","avatar_url":"https://avatars3.githubusercontent.com/u/22214928?v=4","gravatar_id":"","url":"https://api.github.com/users/opetrova","html_url":"https://github.com/opetrova","followers_url":"https://api.github.com/users/opetrova/followers","following_url":"https://api.github.com/users/opetrova/following{/other_user}","gists_url":"https://api.github.com/users/opetrova/gists{/gist_id}","starred_url":"https://api.github.com/users/opetrova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opetrova/subscriptions","organizations_url":"https://api.github.com/users/opetrova/orgs","repos_url":"https://api.github.com/users/opetrova/repos","events_url":"https://api.github.com/users/opetrova/events{/privacy}","received_events_url":"https://api.github.com/users/opetrova/received_events","type":"User","site_admin":false},"labels":[{"id":951950658,"node_id":"MDU6TGFiZWw5NTE5NTA2NTg=","url":"https://api.github.com/repos/NVIDIA/DALI/labels/enhancement","name":"enhancement","color":"a2eeef","default":true},{"id":951950662,"node_id":"MDU6TGFiZWw5NTE5NTA2NjI=","url":"https://api.github.com/repos/NVIDIA/DALI/labels/question","name":"question","color":"d876e3","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-06T14:54:51Z","updated_at":"2018-11-07T15:45:45Z","closed_at":"2018-11-07T15:45:45Z","author_association":"NONE","body":"Hi,\r\nBoth my inputs and targets are images, but I am having trouble getting a Pipeline to output the correct (image, image) pairs. I used a FileReader to read and randomly shuffle the input images with labels, and another one to read the target images with those same labels:\r\n\r\n    class imagePipe(Pipeline):\r\n    def __init__(self, batch_size, num_threads, device_id, imageset_dir, size):\r\n        super(imagePipe, self).__init__(batch_size, num_threads, device_id)\r\n        self.input = ops.FileReader(file_root=join(imageset_dir,'input'), random_shuffle=True)\r\n        self.target = ops.FileReader(file_root=join(imageset_dir,'target'), file_list = join(datapath,'target', 'labels.txt'), random_shuffle=False)\r\n        self.decode = ops.nvJPEGDecoder(device=\"mixed\", output_type=types.GRAY)\r\n\r\nThe number of target images/labels is less than 1000, so I figured I would have all of them in the buffer, and find the correct targets corresponding to the shuffled batch of inputs in define_graph:\r\n\r\n    def define_graph(self):   \r\n        input_images, input_labels = self.input()\r\n        target_images, target_labels = self.target()\r\n        input_images = self.decode(input_images)\r\n        target_images = self.decode(target_images)\r\n        \r\nThis is where I run into a problem though... I want to return [input_images, targets] where targets[k] = target_images [input_labels[k]], but neither target_images nor input_labels can be indexed or iterated through. Is there a better way to go about it? Any help would be greatly appreciated!\r\n     "}}
{"actor":{"display_login":"opetrova"}}