Delete sends img to trash instead of delete

This commit is contained in:
psychedelicious 2022-09-17 17:19:09 +10:00
parent 20ba51ce7d
commit b74354795d
3 changed files with 4 additions and 1 deletions

View File

@ -15,6 +15,7 @@ from PIL import Image
from pytorch_lightning import logging
from threading import Event
from uuid import uuid4
from send2trash import send2trash
from ldm.gfpgan.gfpgan_tools import real_esrgan_upscale
from ldm.gfpgan.gfpgan_tools import run_gfpgan
@ -228,7 +229,7 @@ def handle_cancel():
@socketio.on('deleteImage')
def handle_delete_image(path):
print(f'>> Delete requested "{path}"')
Path(path).unlink()
send2trash(path)
return make_response("OK")

View File

@ -48,6 +48,7 @@ dependencies:
- opencv-python==4.6.0
- protobuf==3.20.1
- realesrgan==0.2.5.0
- send2trash==1.8.0
- test-tube==0.7.5
- transformers==4.21.2
- torch-fidelity==0.3.0

View File

@ -20,6 +20,7 @@ dependencies:
- realesrgan==0.2.5.0
- test-tube>=0.7.5
- streamlit==1.12.0
- send2trash==1.8.0
- pillow==6.2.0
- einops==0.3.0
- torch-fidelity==0.3.0