Try to add progress bar for face detection plugin

Does not work too well...
This commit is contained in:
Mika Fischer
2011-06-07 18:53:03 +02:00
parent 628c9da5b3
commit bf82b07384
+8
View File
@@ -15,6 +15,10 @@ class FaceDetectorPlugin(QObject):
det = BinaryPatternFaceDetector("/cvhci/data/mctcascades/new-detectors/face_frontal_new.xml")
model = self.wnd_.model_
n_images = model.rowCount()
progress = QProgressDialog("Detecting faces...", "Abort", 0, n_images, self.wnd_);
progress.setWindowModality(Qt.WindowModal);
progress.show()
for i in range(n_images):
index = model.index(i, 0)
item = model.itemFromIndex(index)
@@ -31,6 +35,10 @@ class FaceDetectorPlugin(QObject):
'confidence': face.conf,
}
model.addAnnotation(index, ann)
progress.setValue(i+1);
QCoreApplication.processEvents()
if progress.wasCanceled():
break
def action(self):
return self.sc_