autotag: fix bug when reading file from stdin.

Another attempt at fixing #2. b216057 had a bug where you couldn't pass
a file through stdin because we tried to read the file twice, which we
can't do if the input is a pipe.
This commit is contained in:
evazion
2022-06-29 20:02:18 -05:00
parent 069af1c0c4
commit aaaae88e77
3 changed files with 13 additions and 12 deletions
+1 -2
View File
@@ -32,8 +32,7 @@ class Autotagger:
return
with self.learn.no_bar(), self.learn.no_logging():
images = [PILImage.create(file) for file in files]
dl = self.learn.dls.test_dl(images, bs=bs)
dl = self.learn.dls.test_dl(files, bs=bs)
batch, _ = self.learn.get_preds(dl=dl)
for scores in batch: