Closed guansss closed 1 year ago
good catch, the second part may change I am also debugging there
Actually, looking more closely and at this file,
json_pp < models/interrogators/model.json
it looks like, if already existing that this json file just keeps appending the same entries.
so I think better would be
data = [download_model]
if not os.path.exists(mdir):
os.mkdir(mdir)
elif os.path.exists(mpath):
with io.open(file=mpath, mode='r', encoding='utf-8') as filename:
try:
data = json.load(filename)
# No need to append if it's already contained
if download_model not in data:
data.append(download_model)
except ...
right?
Ah, yeah, would be good to avoid duplicates!
I've already fixed it, also going over your second change. I was having some issues there as well:
batch interrogate dir with images
batch interrogate dir without
=> path / output does not change
(actually in my feature branch) thanks!
This fixes two errors:
UnboundLocalError: local variable 'data' referenced before assignment
when model.json is missing (after a fresh install).TypeError: expected str, bytes or os.PathLike object, not NoneType
when setting input directory in the UI. Reproduction steps: