Spaces:
Runtime error
Runtime error
Update app.py
Browse files16 unmodified lines171819202122232425262767 unmodified lines959697989910010130 unmodified lines13213313413513613713815 unmodified lines1541551561571581591601611621634 unmodified lines16816917017117217317416 unmodified linesimport tensorflow as tfimport piexifimport piexif.helperTITLE = 'DeepDanbooru String'TOKEN = os.environ['TOKEN']MODEL_REPO = 'yo2266911/DeepDanbooru_string'MODEL_FILENAME = 'model-resnet_custom_v3.h5'LABEL_FILENAME = 'tags.txt'67 unmodified linesres[label] = probb = dict(sorted(res.items(),key=lambda item:item[1], reverse=True))a = ', '.join(list(b.keys())).replace('_',' ').replace('(','\(').replace(')','\)')c = ', '.join(list(b.keys()))items = rawimage.infogeninfo = ''30 unmodified linesmessage = "Nothing found in the image."info = f"<div><p>{message}<p></div>"return (a,c,res,info)def main():15 unmodified lineslabel='Score Threshold'),],[gr.outputs.Textbox(label='Output (string)'),gr.outputs.Textbox(label='Output (raw string)'),gr.outputs.Label(label='Output (label)'),gr.outputs.HTML()],examples=[['miku.jpg',0.5],4 unmodified linesDemo for [KichangKim/DeepDanbooru](https://github.com/KichangKim/DeepDanbooru) with "ready to copy" prompt and a prompt analyzer.Modified from [hysts/DeepDanbooru](https://huggingface.co/spaces/hysts/DeepDanbooru)PNG Info code forked from [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)''',theme=args.theme,16 unmodified lines1718192021222324252627282930313267 unmodified lines10010110210310410530 unmodified lines13613713813914014114215 unmodified lines1581591601611621631641651664 unmodified lines17117217317417517616 unmodified linesimport tensorflow as tfimport piexifimport piexif.helperimport reTITLE = 'DeepDanbooru String'url = 'https://huggingface.co/spaces/yo2266911/DeepDanbooru_string/'repo_id, repo_type = re.findall(r'https://huggingface.co/([^/]+)/([^/]+)/', url)print(f'Repository ID: {repo_id}')print(f'Repository type: {repo_type}')MODEL_REPO = f'{repo_id}/{repo_type}'TOKEN = os.environ['TOKEN']MODEL_FILENAME = 'model-resnet_custom_v3.h5'LABEL_FILENAME = 'tags.txt'67 unmodified linesres[label] = probb = dict(sorted(res.items(),key=lambda item:item[1], reverse=True))a = ', '.join(list(b.keys())).replace('_',' ').replace('(','\(').replace(')','\)')items = rawimage.infogeninfo = ''30 unmodified linesmessage = "Nothing found in the image."info = f"<div><p>{message}<p></div>"return (info,a,res)def main():15 unmodified lineslabel='Score Threshold'),],[gr.outputs.HTML(),gr.outputs.Textbox(label='DeepDanbooru Output (string)'),gr.outputs.Label(label='DeepDanbooru Output (label)')],examples=[['miku.jpg',0.5],4 unmodified linesDemo for [KichangKim/DeepDanbooru](https://github.com/KichangKim/DeepDanbooru) with "ready to copy" prompt and a prompt analyzer.Modified from [hysts/DeepDanbooru](https://huggingface.co/spaces/hysts/DeepDanbooru)PNG Info code forked from [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)''',theme=args.theme,
app.py+10-8