Spaces:
Build error
Build error
First model version
Browse files
app.py
CHANGED
@@ -42,6 +42,9 @@ def infer(filepath):
|
|
42 |
patchs = [image[box[1]:box[3], box[0]:box[2], :] for box in result_boxes]
|
43 |
patchs = [preprocess(patch, config.dataset_image_width, config.dataset_image_height) for patch in patchs]
|
44 |
patchs = torch.stack(patchs, dim=0)
|
|
|
|
|
|
|
45 |
|
46 |
visual_image = det_demo.visualization(image.copy(), result_polygons, result_masks, result_boxes)
|
47 |
|
|
|
42 |
patchs = [image[box[1]:box[3], box[0]:box[2], :] for box in result_boxes]
|
43 |
patchs = [preprocess(patch, config.dataset_image_width, config.dataset_image_height) for patch in patchs]
|
44 |
patchs = torch.stack(patchs, dim=0)
|
45 |
+
res = model(patchs)
|
46 |
+
rec_result = postprocess(res, charset, 'alignment')[0]
|
47 |
+
print(rec_result)
|
48 |
|
49 |
visual_image = det_demo.visualization(image.copy(), result_polygons, result_masks, result_boxes)
|
50 |
|