JulianPhillips commited on
Commit
c78cb61
·
verified ·
1 Parent(s): c638cd1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -8,9 +8,18 @@ import os
8
  import requests
9
  from tempfile import NamedTemporaryFile
10
 
11
- # Load MoveNet model
 
 
 
12
  movenet_model_path = '/models/movenet/movenet_lightning'
13
- movenet_model = tf.saved_model.load(movenet_model_path)
 
 
 
 
 
 
14
 
15
  # Load BLIP model
16
  blip_model = BlipForConditionalGeneration.from_pretrained('Salesforce/blip-image-captioning-large')
 
8
  import requests
9
  from tempfile import NamedTemporaryFile
10
 
11
+
12
+ import tensorflow_hub as hub
13
+
14
+
15
  movenet_model_path = '/models/movenet/movenet_lightning'
16
+
17
+ # Check if the model path exists
18
+ if not os.path.exists(movenet_model_path):
19
+ # Download the model from TensorFlow Hub
20
+ movenet_model = hub.load("https://tfhub.dev/google/movenet/singlepose/lightning/4")
21
+ else:
22
+ movenet_model = tf.saved_model.load(movenet_model_path)
23
 
24
  # Load BLIP model
25
  blip_model = BlipForConditionalGeneration.from_pretrained('Salesforce/blip-image-captioning-large')