Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,8 +10,9 @@ model = tf.saved_model.load("best_saved_model") #Loading the saved model
|
|
| 10 |
|
| 11 |
def process_img(img):
|
| 12 |
img = img.resize((640,640)) # resize the image as reqired for the model input
|
|
|
|
| 13 |
copy_img = img.copy()
|
| 14 |
-
img =
|
| 15 |
img = img.astype("float32") # Convert the format double to format float
|
| 16 |
img = np.expand_dims(img,axis=0) # exapanding dimension to add batch
|
| 17 |
return img,copy_img
|
|
|
|
| 10 |
|
| 11 |
def process_img(img):
|
| 12 |
img = img.resize((640,640)) # resize the image as reqired for the model input
|
| 13 |
+
img = np.array(img)
|
| 14 |
copy_img = img.copy()
|
| 15 |
+
img = img/255 # Normalizing the picel value
|
| 16 |
img = img.astype("float32") # Convert the format double to format float
|
| 17 |
img = np.expand_dims(img,axis=0) # exapanding dimension to add batch
|
| 18 |
return img,copy_img
|