groakat / AudioTagger

5 stars 2 forks source link

Labels not recognised since branch merge #30

Closed ali-fairbrass closed 10 years ago

ali-fairbrass commented 10 years ago

When looking at files that have been labelled previously and have an associated .json file, the bounding boxes are not displayed and an error message is shown in the cmd window, which I assume is saying that the labels are not recognised. Is there any way to recover the bounding boxes and their labels? See error message below:


KeyError Traceback (most recent call last) C:\Users\ucfaalf\Documents\GitHub\AudioTagger\AudioTagger\audioTagger.py in load Next(self) 424 425 def loadNext(self): --> 426 self.loadFileIdx(self.fileidx + 1) 427 # canProceed = self.checkIfSavingNecessary() 428 # if not canProceed:

C:\Users\ucfaalf\Documents\GitHub\AudioTagger\AudioTagger\audioTagger.py in load FileIdx(self, idx) 415 if idx > 0 and idx < len(self.filelist) - 1: 416 self.fileidx = idx --> 417 self.resetView() 418 419

C:\Users\ucfaalf\Documents\GitHub\AudioTagger\AudioTagger\audioTagger.py in rese tView(self) 388 self.clearSceneRects() 389 self.updateSpecLabel() --> 390 self.loadSceneRects() 391 self.zoom(1) 392

C:\Users\ucfaalf\Documents\GitHub\AudioTagger\AudioTagger\audioTagger.py in load SceneRects(self, fileAppendix) 695 with open(filename, "r") as f: 696 rects = json.load(f) --> 697 self.convertRectsToLabelRects(rects) 698 699 self.contentChanged = False

C:\Users\ucfaalf\Documents\GitHub\AudioTagger\AudioTagger\audioTagger.py in conv ertRectsToLabelRects(self, labels) 661 662 try: --> 663 penCol = self.labelTypes[c] 664 except ValueError: 665 msgBox = QtGui.QMessageBox()

KeyError: u'bird'

ali-fairbrass commented 10 years ago

I think this change might have caused a problem.

Since syncing GitHub, I now receive this error message on running AudioTagger:


TypeError Traceback (most recent call last) C:\Users\ucfaalf\Anaconda\lib\site-packages\IPython\utils\py3compat.pyc in execf ile(fname, glob, loc) 195 else: 196 filename = fname --> 197 exec compile(scripttext, filename, 'exec') in glob, loc 198 else: 199 def execfile(fname, *where):

C:\Users\ucfaalf\Documents\GitHub\AudioTagger\AudioTagger\audioTagger.py in <mod ule>() 892 # w = AudioTagger(basefolder=audiofolder, labelfolder=labelfolder, l abelTypes=labelTypes) 893 # w = AudioTagger(basefolder=audiofolder, labelfolder=labelfolder, l abelTypes=None) --> 894 w = AudioTagger(basefolder=None, labelfolder=None, labelTypes=None) 895 896 sys.exit(app.exec_())

C:\Users\ucfaalf\Documents\GitHub\AudioTagger\AudioTagger\audioTagger.py in in it(self, basefolder, labelfolder, labelTypes) 94 95 if labelTypes is None: ---> 96 self.loadSettingsLocal() 97 self.contentChanged = False 98 else:

C:\Users\ucfaalf\Documents\GitHub\AudioTagger\AudioTagger\audioTagger.py in load SettingsLocal(self) 254 255 keySequences = settings.value("keySequences") --> 256 self.fileidx = int(settings.value("fileIdx")) 257 if not self.fileidx: 258 self.fileidx = 0

TypeError: int() argument must be a string or a number, not 'NoneType'

ali-fairbrass commented 10 years ago

Also I should have mentioned that AudioTagger no longer runs :sob:

groakat commented 10 years ago

If you need to fix it quickly change the line where the error occurs and the lines below to:

self.fileidx = settings.value("fileIdx")

if not self.fileidx:
    self.fileidx = 0
else:
    self.fileidx = int(self.fileidx)

On 11 July 2014 20:37:30 GMT+01:00, ali-fairbrass notifications@github.com wrote:

I think this change might have caused a problem.

Since syncing GitHub, I now receive this error message on running AudioTagger:


TypeError Traceback (most recent call last) C:\Users\ucfaalf\Anaconda\lib\site-packages\IPython\utils\py3compat.pyc in execf ile(fname, glob, loc) 195 else: 196 filename = fname --> 197 exec compile(scripttext, filename, 'exec') in glob, loc 198 else: 199 def execfile(fname, *where):

C:\Users\ucfaalf\Documents\GitHub\AudioTagger\AudioTagger\audioTagger.py in <mod ule>() 892 # w = AudioTagger(basefolder=audiofolder, labelfolder=labelfolder, l abelTypes=labelTypes) 893 # w = AudioTagger(basefolder=audiofolder, labelfolder=labelfolder, l abelTypes=None) --> 894 w = AudioTagger(basefolder=None, labelfolder=None, labelTypes=None) 895 896 sys.exit(app.exec_())

C:\Users\ucfaalf\Documents\GitHub\AudioTagger\AudioTagger\audioTagger.py in in it(self, basefolder, labelfolder, labelTypes) 94 95 if labelTypes is None: ---> 96 self.loadSettingsLocal() 97 self.contentChanged = False 98 else:

C:\Users\ucfaalf\Documents\GitHub\AudioTagger\AudioTagger\audioTagger.py in load SettingsLocal(self) 254 255 keySequences = settings.value("keySequences") --> 256 self.fileidx = int(settings.value("fileIdx")) 257 if not self.fileidx: 258 self.fileidx = 0

TypeError: int() argument must be a string or a number, not 'NoneType'


Reply to this email directly or view it on GitHub: https://github.com/groakat/AudioTagger/issues/30#issuecomment-48773692

Sent from my Android device with K-9 Mail. Please excuse my brevity.