LucasThePatator / FaceDetectCrop

1 stars 0 forks source link

references db fails if an unsupporting file type is in the ref folder #12

Closed m-btt closed 1 year ago

m-btt commented 1 year ago

.rar filetype causes references processing to fail and stop.

ref log file: reference\Kpop Soloist IU/FmcLBOKaAAEf3ud.jpg : added to db reference\Kpop Soloist IU/IU-WF-512pbwaligned.rar

console error: Kpop Soloist IU: 18%|███████████████▍ | 2/11 [00:03<00:17, 1.99s/it] Folders: 88%|████████████████████████████████████████████████████████████████▎ | 52/59 [11:07<01:29, 12.84s/it]3<00:19, 2.12s/it] Traceback (most recent call last): File "D:\Firefox Downloads\poop main\main.py", line 292, in <module> main() File "D:\Firefox Downloads\poop main\main.py", line 277, in main classifier.make_ref_db(args.reference, update=args.update_db) File "D:\Firefox Downloads\poop main\main.py", line 88, in make_ref_db with Image.open(directory / name / filename) as image: File "C:\Python310\lib\site-packages\PIL\Image.py", line 3280, in open raise UnidentifiedImageError(msg) PIL.UnidentifiedImageError: cannot identify image file 'D:\\Firefox Downloads\\poop main\\reference\\Kpop Soloist IU\\IU-WF-512pbwaligned.rar'

Expected behavior would be for file to be skipped and processing to continue.

m-btt commented 1 year ago

To note as well that any reference database build/update failure yields no .db file at all, so if doing a batch of 100s of references the entire references processing will need to be done again from the start after removing the problematic file. Not sure if it's possible/wanted to create it at the end of processing including if an error happens during it. (If so would probs be a new issue to be opened ig)