Commit Graph

25 Commits

Author SHA1 Message Date
evazion 31d4f7a22f Update README.md 2022-06-29 21:08:03 -05:00
evazion e3d0c8aac8 Add README. 2022-06-29 20:58:27 -05:00
evazion aaaae88e77 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.
2022-06-29 20:02:18 -05:00
evazion 069af1c0c4 web: add basic error handling.
Handle unexpected errors in the web service, for example if given an
invalid or corrupt image file.
2022-06-29 18:25:15 -05:00
evazion b2160576fc Better fix for #2 (Crashes when encountering files that aren't images)
* Only ignore invalid files in the `autotag` script, not in the
  web service. In the web service we want to return an error if given an
  invalid or corrupt file.

* Use the logger to log a warning instead of printing directly to stderr.
2022-06-29 18:25:11 -05:00
evazion 6719ed3a40 gunicorn: fix log format. 2022-06-29 14:53:50 -05:00
evazion 7c4f52f7d5 Revert "Print correct filenames when files are skipped"
This reverts commit b0b93eb471.

Broke the webapp output.
2022-06-29 14:47:29 -05:00
evazion 24a842d847 gunicorn: output logs in JSON format. 2022-06-29 14:41:58 -05:00
evazion b71f7d654d Merge pull request #4 from dokutan/master
Print correct filenames when files are skipped
2022-06-29 14:20:52 -05:00
dokutan b0b93eb471 Print correct filenames when files are skipped 2022-06-28 19:01:43 +02:00
dokutan 9fd7697c80 Print skipped files 2022-06-28 18:44:49 +02:00
evazion 38beec98e4 Merge pull request #3 from dokutan/master
Skip files that aren't images
2022-06-28 03:28:26 -05:00
dokutan 8e4690b1b3 Skip files that aren't images 2022-06-26 21:05:10 +02:00
evazion d43ce9c4e7 autotag: add option for taking list of files from a text file.
Add an option for taking the list of input files from a text file:

  ./autotag -i files.txt

This is useful in conjunction with the `find` command:

  find ~/images/ -name '*.jpg' | ./autotag -i -
2022-06-22 17:16:22 -05:00
evazion e598c7de16 autotag: add CSV output mode. 2022-06-22 16:34:34 -05:00
evazion 0648b529d0 autotag: allow outputting filename without path or extension.
This is useful when performing batch inference on the Danbooru dataset.
In this case the filename is the MD5, so this makes the output return
only the MD5 instead of the full path to the image file.
2022-06-22 16:12:46 -05:00
evazion 96b6a12924 autotag: accept files from stdin with '-'.
Fix `autotag` so you can pass a filename of '-' to read a file from
stdin. This way you can do this:

  docker run --rm -i ghcr.io/danbooru/autotagger autotag - < image.jpg

...to perform prediction on a single file outside of Docker.
2022-06-22 15:25:48 -05:00
evazion e4344ab2d4 Merge pull request #1 from dokutan/master
Fix AttributeError
2022-06-22 15:11:20 -05:00
dokutan 22e1f2be7d Fix AttributeError 2022-06-22 20:11:46 +02:00
evazion a4db87e8a0 autotag: allow recursively processing directories.
* Make it so you can give the `autotag` script a mixed list of files and
  directories, and it will recursively process every file in each directory.

* Allow choosing the output format: one (filename, tag, score) tuple per
  line, or one (filename, tags) tuple per line.
2022-06-22 04:54:12 -05:00
evazion 07b84d73fe Do batch prediction.
Do batch prediction inside the `predict` method instead of calling
`predict` once for each image.
2022-06-21 20:08:49 -05:00
evazion 5c90c7378d gunicorn: add config file. 2022-06-21 00:32:56 -05:00
evazion 1d238f3466 github: add docker build workflow. 2022-06-21 00:07:50 -05:00
evazion 0bc9cb2372 docker: add model to image. 2022-06-20 23:55:13 -05:00
evazion 55d343cd3d Initial commit. 2022-06-20 23:33:54 -05:00