Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -44,21 +44,21 @@ layout_weights_path = dd.ModelDownloadManager.maybe_download_weights_and_configs
|
|
44 |
categories_layout = dd.ModelCatalog.get_profile(cfg.WEIGHTS.D2LAYOUT).categories
|
45 |
assert categories_layout is not None
|
46 |
assert layout_weights_path is not None
|
47 |
-
d_layout = dd.D2FrcnnDetector(
|
48 |
|
49 |
# cell detector
|
50 |
cell_config_path = dd.ModelCatalog.get_full_path_configs(cfg.CONFIG.D2CELL)
|
51 |
cell_weights_path = dd.ModelDownloadManager.maybe_download_weights_and_configs(cfg.WEIGHTS.D2CELL)
|
52 |
categories_cell = dd.ModelCatalog.get_profile(cfg.WEIGHTS.D2CELL).categories
|
53 |
assert categories_cell is not None
|
54 |
-
d_cell = dd.D2FrcnnDetector(
|
55 |
|
56 |
# row/column detector
|
57 |
item_config_path = dd.ModelCatalog.get_full_path_configs(cfg.CONFIG.D2ITEM)
|
58 |
item_weights_path = dd.ModelDownloadManager.maybe_download_weights_and_configs(cfg.WEIGHTS.D2ITEM)
|
59 |
categories_item = dd.ModelCatalog.get_profile(cfg.WEIGHTS.D2ITEM).categories
|
60 |
assert categories_item is not None
|
61 |
-
d_item = dd.D2FrcnnDetector(
|
62 |
|
63 |
# word detector
|
64 |
det = dd.DoctrTextlineDetector()
|
|
|
44 |
categories_layout = dd.ModelCatalog.get_profile(cfg.WEIGHTS.D2LAYOUT).categories
|
45 |
assert categories_layout is not None
|
46 |
assert layout_weights_path is not None
|
47 |
+
d_layout = dd.D2FrcnnDetector(layout_config_path, layout_weights_path, categories_layout, device=cfg.DEVICE)
|
48 |
|
49 |
# cell detector
|
50 |
cell_config_path = dd.ModelCatalog.get_full_path_configs(cfg.CONFIG.D2CELL)
|
51 |
cell_weights_path = dd.ModelDownloadManager.maybe_download_weights_and_configs(cfg.WEIGHTS.D2CELL)
|
52 |
categories_cell = dd.ModelCatalog.get_profile(cfg.WEIGHTS.D2CELL).categories
|
53 |
assert categories_cell is not None
|
54 |
+
d_cell = dd.D2FrcnnDetector(cell_config_path, cell_weights_path, categories_cell, device=cfg.DEVICE)
|
55 |
|
56 |
# row/column detector
|
57 |
item_config_path = dd.ModelCatalog.get_full_path_configs(cfg.CONFIG.D2ITEM)
|
58 |
item_weights_path = dd.ModelDownloadManager.maybe_download_weights_and_configs(cfg.WEIGHTS.D2ITEM)
|
59 |
categories_item = dd.ModelCatalog.get_profile(cfg.WEIGHTS.D2ITEM).categories
|
60 |
assert categories_item is not None
|
61 |
+
d_item = dd.D2FrcnnDetector(item_config_path, item_weights_path, categories_item, device=cfg.DEVICE)
|
62 |
|
63 |
# word detector
|
64 |
det = dd.DoctrTextlineDetector()
|