Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add list_from_file and list_to_file #226

Merged
merged 4 commits into from May 24, 2021
Merged

Add list_from_file and list_to_file #226

merged 4 commits into from May 24, 2021

Conversation

innerlee
Copy link
Contributor

This simplifies code, and avoids direct manipulations of text io.

Signed-off-by: lizz <lizz@sensetime.com>
@codecov
Copy link

codecov bot commented May 21, 2021

Codecov Report

Merging #226 (86a47b6) into main (ecfc1c7) will increase coverage by 0.02%.
The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #226      +/-   ##
==========================================
+ Coverage   85.94%   85.96%   +0.02%     
==========================================
  Files         131      132       +1     
  Lines        8807     8807              
  Branches     1239     1239              
==========================================
+ Hits         7569     7571       +2     
+ Misses        936      934       -2     
  Partials      302      302              
Flag Coverage Δ
unittests 85.96% <84.61%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmocr/models/kie/extractors/sdmgr.py 83.33% <25.00%> (+3.74%) ⬆️
mmocr/models/textrecog/convertors/base.py 88.67% <80.00%> (ø)
mmocr/datasets/kie_dataset.py 88.11% <100.00%> (-0.12%) ⬇️
mmocr/datasets/utils/loader.py 98.18% <100.00%> (ø)
mmocr/utils/fileio.py 100.00% <100.00%> (ø)
mmocr/utils/lmdb_util.py 74.28% <100.00%> (ø)
mmocr/models/textdet/modules/utils.py 100.00% <0.00%> (ø)
mmocr/models/textdet/modules/local_graph.py 100.00% <0.00%> (ø)
...ocr/models/textdet/modules/proposal_local_graph.py 98.99% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ecfc1c7...86a47b6. Read the comment docs.

line = line.strip()
if line != '':
self.idx2char.append(line)
for line in list_from_file(dict_file):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BE CAREFUL. MAKE SURE THERE IS NO PROBLEM ABOUT SOME CHARACTERS SUCH AS CHINESE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add tests on that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Tests added. Any more to add?

@cuhk-hbsun cuhk-hbsun merged commit b10b640 into main May 24, 2021
@cuhk-hbsun cuhk-hbsun deleted the zz/textio branch May 24, 2021 06:01
gaotongxiao pushed a commit to gaotongxiao/mmocr that referenced this pull request Jul 15, 2022
* Add list_from_file and list_to_file

Signed-off-by: lizz <lizz@sensetime.com>

* Add test list_to_file and list_from_file

* more

* Fix tests
gaotongxiao pushed a commit to gaotongxiao/mmocr that referenced this pull request Jul 15, 2022
* Add list_from_file and list_to_file

Signed-off-by: lizz <lizz@sensetime.com>

* Add test list_to_file and list_from_file

* more

* Fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants