boss getting close
This commit is contained in:
parent
f914443d86
commit
aee3a7f22c
19 changed files with 422 additions and 119 deletions
|
|
@ -472,6 +472,8 @@ class Annotator:
|
|||
# ── mouse ─────────────────────────────────────────────────────
|
||||
|
||||
def _on_mouse(self, ev, wx, wy, flags, _):
|
||||
if self.img is None:
|
||||
return
|
||||
nx, ny = self._to_norm(wx, wy)
|
||||
self.mouse_n = (nx, ny)
|
||||
|
||||
|
|
@ -628,20 +630,18 @@ class Annotator:
|
|||
# ── main loop ─────────────────────────────────────────────────
|
||||
|
||||
def run(self):
|
||||
if not self.all_files:
|
||||
print(f"No images in {self.img_dir}")
|
||||
return
|
||||
|
||||
cv2.namedWindow(self.WIN, cv2.WINDOW_NORMAL)
|
||||
cv2.resizeWindow(self.WIN, self.ww, self.wh)
|
||||
cv2.setMouseCallback(self.WIN, self._on_mouse)
|
||||
|
||||
self._refilter()
|
||||
if not self.files:
|
||||
print("No images match current filter")
|
||||
return
|
||||
self._load()
|
||||
self._draw()
|
||||
if not self.all_files:
|
||||
print(f"No images in {self.img_dir}")
|
||||
self._draw()
|
||||
else:
|
||||
self._refilter()
|
||||
if self.files:
|
||||
self._load()
|
||||
self._draw()
|
||||
|
||||
while True:
|
||||
key = cv2.waitKeyEx(30)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue