Update modeling_omniparser.py
Browse files- modeling_omniparser.py +2 -4
modeling_omniparser.py
CHANGED
|
@@ -48,14 +48,12 @@ class OmniparserModel(PreTrainedModel):
|
|
| 48 |
repo_id="ThomasDh-C/OmniParser-v2.0",
|
| 49 |
allow_patterns="icon_detect/**",
|
| 50 |
)
|
| 51 |
-
|
| 52 |
-
self.icon_detect_path = os.path.join(icon_detect_path, 'model.pt')
|
| 53 |
icon_caption_path = snapshot_download(
|
| 54 |
repo_id="ThomasDh-C/OmniParser-v2.0",
|
| 55 |
allow_patterns="icon_caption/**",
|
| 56 |
)
|
| 57 |
-
|
| 58 |
-
caption_model_processor = self.get_caption_model_processor(model_name_or_path=icon_caption_path)
|
| 59 |
self.caption_model, self.caption_model_processor = caption_model_processor['model'], caption_model_processor['processor']
|
| 60 |
self.reader = easyocr.Reader(['en'])
|
| 61 |
self.to_pil = ToPILImage()
|
|
|
|
| 48 |
repo_id="ThomasDh-C/OmniParser-v2.0",
|
| 49 |
allow_patterns="icon_detect/**",
|
| 50 |
)
|
| 51 |
+
self.icon_detect_path = os.path.join(icon_detect_path, 'icon_detect', 'model.pt')
|
|
|
|
| 52 |
icon_caption_path = snapshot_download(
|
| 53 |
repo_id="ThomasDh-C/OmniParser-v2.0",
|
| 54 |
allow_patterns="icon_caption/**",
|
| 55 |
)
|
| 56 |
+
caption_model_processor = self.get_caption_model_processor(model_name_or_path=os.path.join(icon_caption_path, 'icon_caption'))
|
|
|
|
| 57 |
self.caption_model, self.caption_model_processor = caption_model_processor['model'], caption_model_processor['processor']
|
| 58 |
self.reader = easyocr.Reader(['en'])
|
| 59 |
self.to_pil = ToPILImage()
|