Spaces:
Sleeping
Sleeping
zhijian12345
commited on
Commit
·
5498d38
1
Parent(s):
7c36eb0
Update app.py
Browse files
app.py
CHANGED
@@ -9,15 +9,8 @@ from math import sqrt
|
|
9 |
import gradio as gr
|
10 |
import numpy as np
|
11 |
|
12 |
-
model_info = """
|
13 |
-
**模型名称**: Google/vit-base-patch16-224
|
14 |
-
**模型介绍**: 本程序根据huggingface上Google开源模型vit,在猫狗图片数据上进行微调,上传一张图片,将会预测其类别并显示结果。模型官网:https://huggingface.co/google/vit-base-patch16-224
|
15 |
-
**程序作者**: 计科三班 王志建、计科三班 罗楷轩
|
16 |
-
**特别支持**: 计科三班 黄成栋
|
17 |
-
"""
|
18 |
-
|
19 |
# 加载图像分类模型
|
20 |
-
checkpoint_dir = "
|
21 |
classifier = pipeline("image-classification", model=checkpoint_dir) # 创建图像分类器模型
|
22 |
vitclassifier = pipeline("image-classification",model="google/vit-base-patch16-224")
|
23 |
|
|
|
9 |
import gradio as gr
|
10 |
import numpy as np
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
# 加载图像分类模型
|
13 |
+
checkpoint_dir = "./checkpoint/checkpoint-905" # 模型检查点目录
|
14 |
classifier = pipeline("image-classification", model=checkpoint_dir) # 创建图像分类器模型
|
15 |
vitclassifier = pipeline("image-classification",model="google/vit-base-patch16-224")
|
16 |
|