fix #24: rm img_meta from inference (#25)

pull/2/head
Hongbin Sun 2021-04-05 18:01:43 +08:00 committed by GitHub
parent e546d044c8
commit cb1b2c2fa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -32,10 +32,10 @@
## Results and Models
| Backbone | Neck | Head | | | Regular Text | | | Irregular Text | download |
| :------: | :----: | :--: | :-: | :----: | :----------: | :--: | :-: | :------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| | | | | IIIT5K | SVT | IC13 | | CT80 |
| R31-1/16 | FPNOCR | 1x | | 90.9 | 81.8 | 90.7 | | 80.9 | [model](https://download.openmmlab.com/mmocr/textrecog/seg/seg_r31_1by16_fpnocr_academic-0c50e163.pth) \| [log](https://download.openmmlab.com/mmocr/textrecog/seg/20210325_112835.log.json) |
|Backbone|Neck|Head|||Regular Text|||Irregular Text|download
| :-------------: | :-----: | :-----: | :------: | :-----: | :----: | :-----: | :-----: | :-----: | :-----: |
|||||IIIT5K|SVT|IC13||CT80|
|R31-1/16|FPNOCR|1x||90.9|81.8|90.7||80.9|[model](https://download.openmmlab.com/mmocr/textrecog/seg/seg_r31_1by16_fpnocr_academic-72235b11.pth) \| [log](https://download.openmmlab.com/mmocr/textrecog/seg/20210325_112835.log.json) |
**Notes:**

View File

@ -26,7 +26,7 @@ def model_inference(model, img):
data = collate([data], samples_per_gpu=1)
# just get the actual data from DataContainer
data['img_metas'] = [img_metas.data[0] for img_metas in data['img_metas']]
# data['img_metas'] = [img_metas.data[0] for img_metas in data['img_metas']]
if next(model.parameters()).is_cuda:
# scatter to specified GPU

View File

@ -21,7 +21,7 @@ def process_checkpoint(in_file, out_file):
# if it is necessary to remove some sensitive data in checkpoint['meta'],
# add the code here.
if 'meta' in checkpoint:
checkpoint['meta'] = ''
checkpoint['meta'] = {'CLASSES': 0}
torch.save(checkpoint, out_file)
sha = subprocess.check_output(['sha256sum', out_file]).decode()
final_file = out_file.rstrip('.pth') + '-{}.pth'.format(sha[:8])