XSegEditor: fixed incorrect count of labeled images.

This commit is contained in:
Colombo 2020-06-21 00:56:25 +04:00
parent 2b8e8f0554
commit 27f219fec7

View file

@ -1294,10 +1294,16 @@ class MainWindow(QXMainWindow):
ie_polys = dflimg.get_seg_ie_polys()
new_ie_polys = self.canvas.op.get_ie_polys()
if not new_ie_polys.identical(ie_polys):
new_has_ie_polys = new_ie_polys.has_polys()
self.set_has_ie_polys_count ( self.get_has_ie_polys_count() + (1 if new_has_ie_polys else -1) )
self.image_paths_has_ie_polys[image_path] = new_has_ie_polys
if not new_ie_polys.identical(ie_polys):
prev_has_polys = self.image_paths_has_ie_polys[image_path]
self.image_paths_has_ie_polys[image_path] = new_ie_polys.has_polys()
new_has_polys = self.image_paths_has_ie_polys[image_path]
if not prev_has_polys and new_has_polys:
self.set_has_ie_polys_count ( self.get_has_ie_polys_count() +1)
elif prev_has_polys and not new_has_polys:
self.set_has_ie_polys_count ( self.get_has_ie_polys_count() -1)
dflimg.set_seg_ie_polys( new_ie_polys )
dflimg.save()