Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,14 +11,14 @@ os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
|
|
11 |
|
12 |
|
13 |
# Create an instance of the model
|
14 |
-
|
15 |
-
|
16 |
test_loss = tf.keras.metrics.Mean(name='test_loss')
|
17 |
|
18 |
|
19 |
def recognize_text(input_image):
|
20 |
x, x_mask=data.preprocess_img(input_image)
|
21 |
-
output_str, gifImage=CALTextModel.predict(x, x_mask)
|
22 |
return output_str,gifImage
|
23 |
|
24 |
examples = [['sample_test_images/59-11.png'],
|
|
|
11 |
|
12 |
|
13 |
# Create an instance of the model
|
14 |
+
CALText = CALTextModel.CALText_Model(training=False)
|
15 |
+
CALText.load_weights('final_caltextModel/cp-0037.ckpt')
|
16 |
test_loss = tf.keras.metrics.Mean(name='test_loss')
|
17 |
|
18 |
|
19 |
def recognize_text(input_image):
|
20 |
x, x_mask=data.preprocess_img(input_image)
|
21 |
+
output_str, gifImage=CALTextModel.predict(CALText, x, x_mask)
|
22 |
return output_str,gifImage
|
23 |
|
24 |
examples = [['sample_test_images/59-11.png'],
|