q6 commited on
Commit
c8b3c75
·
1 Parent(s): 9dcd21c

Omit PNGs without NovelAI prompts

Browse files
Files changed (1) hide show
  1. scan.py +4 -5
scan.py CHANGED
@@ -213,16 +213,15 @@ def main():
213
  key=lambda path: path.as_posix().casefold(),
214
  )
215
  files = [scan(path) for path in paths]
216
- found = sum(item["prompt_found"] for item in files)
217
  result = {
218
  "root": ROOT.resolve().as_posix(),
219
- "total": len(files),
220
- "found": found,
221
- "missing": len(files) - found,
222
  "files": files,
223
  }
224
  OUTPUT.write_text(json.dumps(result, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
225
- print(f"Scanned {len(files)} PNGs; found {found}; wrote {OUTPUT}")
226
 
227
 
228
  main()
 
213
  key=lambda path: path.as_posix().casefold(),
214
  )
215
  files = [scan(path) for path in paths]
216
+ files = [item for item in files if item["prompt_found"]]
217
  result = {
218
  "root": ROOT.resolve().as_posix(),
219
+ "scanned": len(paths),
220
+ "found": len(files),
 
221
  "files": files,
222
  }
223
  OUTPUT.write_text(json.dumps(result, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
224
+ print(f"Scanned {len(paths)} PNGs; found {len(files)}; wrote {OUTPUT}")
225
 
226
 
227
  main()