Open yangzhikai opened 4 years ago
when I set the json file as: { "number1.jpg": {"attribute1": 1, "attribute2": 2}, "number2.jpg": {"attribute1": 12, "attribute2": 22}, "number3.jpg": {"attribute1": 13, "attribute2": 23}, "number4.jpg": {"attribute1": 14, "attribute2": 24} } I run the function "loadAttribDict" in attrib_dataset.py a disordered variable "shiftAttribVal" is produced: {'maxIterAtScale': {1: 0, 12: 1, 13: 2, 14: 3}, 'maxIterAtScale0': {2: 1, 22: 2, 23: 3, 24: 0}}
I fund a wrong has happend in " for attribName, attribVals in attribList.items(): "
sence 'attribVals' become to be {1, 12, 13, 14} and {24, 2, 22, 23}.
Unitl I have changaed 'attribList[attribName] = set() ' as attribList[attribName] = list()
and next rogram command 'attribList[attribName].add(attribVal)' as 'add(attribVal)'
in "def loadAttribDict" ,the disorder has been solved.
I think you should discribe the attribution json file in more detail.
A false form about .json file, mentioned in "pathAttribDict(string):" They should be : { "number1.jpg": {"attribute1": 1, "attribute2": 2, ...} "numbe2r.jpg": {"attribute1": 1, "attribute2": 2, ...} }