Skip to content

Commit

Permalink
add the lost 'get_image_id' function
Browse files Browse the repository at this point in the history
  • Loading branch information
wenh06 committed Jul 2, 2020
1 parent bb63ccd commit 100edcf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,15 @@ def _get_val_item(self, index):
return img, target


def get_image_id(filename:str) -> int:
"""Convert a string to a integer."""
raise NotImplementedError("Create your own 'get_image_id' function")
lv, no = os.path.splitext(os.path.basename(filename))[0].split("_")
lv = lv.replace("level", "")
no = f"{int(no):04d}"
return int(lv+no)


if __name__ == "__main__":
from cfg import Cfg

Expand Down

0 comments on commit 100edcf

Please sign in to comment.