Azure / ObjectDetectionUsingCntk

Fast R-CNN Object Detection on Azure using CNTK
128 stars 61 forks source link

How can i get a message (true-false) if img.jpg have labels? #15

Closed fct-edilberto closed 7 years ago

fct-edilberto commented 7 years ago

in 6_scoreImage i like to obtain a message true/false if the image have any label or not because i have a lot of images

if something:
    print('TRUE')
else:
    print('FALSE')
mwangimorris commented 7 years ago
 #loop over all images
  imgFilenames = getFilesInDirectory(imagesToAnnotateDir, ".jpg")
  for imgIndex, imgFilename in enumerate(imgFilenames):
       labelsPath = os.path.join(imagesToAnnotateDir , imgFilename[:-4] + ".bboxes.labels.tsv")
       if os.path.exists(labelsPath):
           return True //and go to other images with no labels
  return False