Skip to content

Commit

Permalink
seeking
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Sep 2, 2020
1 parent 70b2426 commit 3dd17e9
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tools/selector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
import os
import pygame
import sys
import glob
from window import Window
Expand Down Expand Up @@ -32,11 +33,20 @@
# permanent camera occulusions
EXCLUDE_USERS = ["807f77aac0daa4b6", "84e6a31bffe59bee"]

seek_fn = glob.glob("imgs/"+(mask % (cc-1))+"*")[0].split("_", 1)[1]
print(seek_fn)

o = 2
dat = open(sys.argv[2]).read().strip().split("\n")
for d in tqdm(dat):
fn = os.path.join(BASEDIR, d.split(":")[0].replace("/ent.txt", ""))
dd = sorted(os.listdir(fn))
if seek_fn is not None:
#print(dd[1], seek_fn)
if not dd[1].endswith(seek_fn):
continue
seek_fn = None

if dd[1][5:] in seen:
continue
if dd[1].split("_")[1] in EXCLUDE_USERS:
Expand All @@ -45,11 +55,9 @@

ii = np.array(Image.open(os.path.join(fn, dd[1])))
segi = fix(Image.open(os.path.join(fn, dd[2])))
o = 1
pii = ii*((10-o)/10) + segi*(o/10)

win.draw(pii)
while 1:
pii = ii*((10-o)/10) + segi*(o/10)
win.draw(pii)
kk = win.getkey()
if kk == ord("z"):
suf = dd[1][5:]
Expand All @@ -61,6 +69,10 @@
im.save(outn.replace("imgs/", "masks/"))
cc += 1
break
elif kk == pygame.locals.K_UP:
o = min(10, o+1)
elif kk == pygame.locals.K_DOWN:
o = max(0, o-1)
elif kk == ord(" "):
break

Expand Down

0 comments on commit 3dd17e9

Please sign in to comment.