Commit Graph

7 Commits

Author SHA1 Message Date
evazion 1edfba77c9 gunicorn: don't use shared memory for model.
Docker Build / docker-build (push) Waiting to run
This didn't seem to be necessary, and it made running in Docker more difficult
since you have to use --shm-size=1G to raise the shared memory limit.
2022-06-30 21:15:45 -05:00
evazion 524a2a8c7b gunicorn: fix deadlock when preload + multiple workers was enabled.
Fix Gunicorn hanging on startup when preloading and multiple workers
were enabled. There was some bad interaction between multithreading in
Pytorch and preloading in Gunicorn (possibly because Pytorch can't
survive a fork?). Disabling threading in Pytorch fixes it.
2022-06-30 20:57:19 -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 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 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 55d343cd3d Initial commit. 2022-06-20 23:33:54 -05:00