Tushar-N / attributes-as-operators

Attribute-Object Visual Composition using Attributes as Operators
MIT License
64 stars 17 forks source link

Confusion in the Dataloader #7

Open ASMIftekhar opened 4 years ago

ASMIftekhar commented 4 years ago

Thanks a lot for your beautiful work. While looking into the repository I got confused with something. In data/dataset.py for commutative reguralizer:

def sample_affordance(self, attr, obj): new_attr = np.random.choice(self.obj_affordance[obj]) if new_attr==attr: return self.sample_affordance(attr, obj) return self.attr2idx[new_attr]

This function is called in line 157 by : inv_attr = self.sample_train_affordance(attr, obj) # attribute for inverse regularizer comm_attr = self.sample_affordance(inv_attr, obj) # attribute for commutative regularizer But inv_attr is the id of an attribute and in function sample_affordance it is getting compared with the name of the attribute which seems to be problematic. Can you have a look into this?