This commit is contained in:
SOULOFCINDER 2023-03-30 11:33:37 +08:00
parent aca9604bc7
commit f6fd6a5042
5 changed files with 5 additions and 3 deletions

View File

@ -1,8 +1,6 @@
import gradio as gr
from PIL import Image
from transformers import BeitImageProcessor, BeitForImageClassification
from PIL import Image
def inference(img):
@ -20,7 +18,7 @@ def inference(img):
return model.config.id2label[predicted_class_idx]
title = "beit-base-patch16-224-pt22k-ft22k"
title = "Image classification:beit-base-patch16-224-pt22k-ft22k"
description = "Gradio Demo for beit-base-patch16-224-pt22k-ft22k. To use it, simply upload your image, or click one of the examples to load them."
article = "<p style='text-align: center'><a href='https://github.com/bryandlee/animegan2-pytorch' target='_blank'>Github Repo Pytorch</a></p> <center><img src='https://visitor-badge.glitch.me/badge?page_id=akhaliq_animegan' alt='visitor badge'></center></p>"
examples=[['example_cat.jpg'],['Masahiro.png']]

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

View File

@ -0,0 +1,4 @@
img,output,flag,username,timestamp
D:\workspace\py\image_classification\beit_base_patch16_224_pt22k_ft22k\flagged\img\tmpcm8vuiq9.png,,,,2023-03-30 10:03:06.225359
D:\workspace\py\image_classification\beit_base_patch16_224_pt22k_ft22k\flagged\img\tmpbfwv5bbb.png,,,,2023-03-30 10:03:08.489673
D:\workspace\py\image_classification\beit_base_patch16_224_pt22k_ft22k\flagged\img\tmp4d3jvm17.jpg,,,,2023-03-30 10:03:11.483544
1 img output flag username timestamp
2 D:\workspace\py\image_classification\beit_base_patch16_224_pt22k_ft22k\flagged\img\tmpcm8vuiq9.png 2023-03-30 10:03:06.225359
3 D:\workspace\py\image_classification\beit_base_patch16_224_pt22k_ft22k\flagged\img\tmpbfwv5bbb.png 2023-03-30 10:03:08.489673
4 D:\workspace\py\image_classification\beit_base_patch16_224_pt22k_ft22k\flagged\img\tmp4d3jvm17.jpg 2023-03-30 10:03:11.483544