hardyliyanto commited on
Commit
530671a
1 Parent(s): 9c16161

updated model to all model

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -8,16 +8,14 @@ import mediapipe as mp
8
  import numpy as np
9
  from PIL import Image
10
 
11
- feature_extractor = ViTImageProcessor.from_pretrained('ArdyL/ViT_SIBI_Kata')
12
- model = AutoModelForImageClassification.from_pretrained('ArdyL/ViT_SIBI_Kata')
13
 
14
 
15
  mp_drawing_styles = mp.solutions.drawing_styles
16
  mp_holistic = mp.solutions.holistic
17
  mp_pose = mp.solutions.pose
18
  mp_drawing = mp.solutions.drawing_utils
19
- examples_dir = './'
20
- example_files = glob.glob(os.path.join(examples_dir, '*.jpg'))
21
 
22
 
23
  def preprocess(im):
@@ -82,13 +80,12 @@ def classify_image(image):
82
  return label # confidences
83
 
84
 
85
- with gr.Blocks(title=">ViT - SIBI Classifier",
86
- css=".gradio-container {background:mintcream;}"
87
  ) as demo:
88
  # gr.HTML("""<div style="font-family:'Times New Roman', 'Serif'; font-size:16pt; font-weight:bold; text-align:center; color:royalblue;">ViT - SIBI Classifier</div>""")
89
 
90
  # txt_2 = gr.Textbox(label="Input 2", visible=False)
91
- with gr.Tab("Upload Image", id='upload-image'):
92
  with gr.Row():
93
  uploadImage = gr.Image(
94
  type="numpy", image_mode="RGB", shape=(224, 224))
 
8
  import numpy as np
9
  from PIL import Image
10
 
11
+ feature_extractor = ViTImageProcessor.from_pretrained('ArdyL/VIT_SIBI_ALL')
12
+ model = AutoModelForImageClassification.from_pretrained('ArdyL/VIT_SIBI_ALL')
13
 
14
 
15
  mp_drawing_styles = mp.solutions.drawing_styles
16
  mp_holistic = mp.solutions.holistic
17
  mp_pose = mp.solutions.pose
18
  mp_drawing = mp.solutions.drawing_utils
 
 
19
 
20
 
21
  def preprocess(im):
 
80
  return label # confidences
81
 
82
 
83
+ with gr.Blocks(title=">ViT - SIBI Classifier"
 
84
  ) as demo:
85
  # gr.HTML("""<div style="font-family:'Times New Roman', 'Serif'; font-size:16pt; font-weight:bold; text-align:center; color:royalblue;">ViT - SIBI Classifier</div>""")
86
 
87
  # txt_2 = gr.Textbox(label="Input 2", visible=False)
88
+ with gr.Tab("Upload Image", id='upload-image', ):
89
  with gr.Row():
90
  uploadImage = gr.Image(
91
  type="numpy", image_mode="RGB", shape=(224, 224))