annanau commited on
Commit
800403d
·
verified ·
1 Parent(s): e24f028

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -12
app.py CHANGED
@@ -4,20 +4,10 @@ from tensorflow.keras.preprocessing import image
4
  import numpy as np
5
  from PIL import Image
6
  from keras import layers
7
- from transformers import TFAutoModelForImageClassification
8
- from transformers import AutoImageProcessor
9
 
10
- # Load model#'model = tf.keras.models.load_model("xception-head")
11
-
12
- # Replace with your Hugging Face model repository name
13
- model_name = "icputrd/Inception-V3-Human-Bodypart-Classifier"
14
-
15
- # Load the pre-trained TensorFlow model from Hugging Face
16
- model = TFAutoModelForImageClassification.from_pretrained(model_name)
17
-
18
- # Load the associated image processor (for preprocessing input images)
19
- image_processor = AutoImageProcessor.from_pretrained(model_name)
20
 
 
 
21
 
22
  # Define the labels for your classification
23
  class_labels = ['arm', 'hand', 'foot', 'legs','fullbody','head','backside', 'torso', 'stake', 'plastic'] # Replace with your actual class names
 
4
  import numpy as np
5
  from PIL import Image
6
  from keras import layers
 
 
7
 
 
 
 
 
 
 
 
 
 
 
8
 
9
+ # Load your trained Xception model
10
+ model = tf.keras.models.load_model("xception-head")
11
 
12
  # Define the labels for your classification
13
  class_labels = ['arm', 'hand', 'foot', 'legs','fullbody','head','backside', 'torso', 'stake', 'plastic'] # Replace with your actual class names