File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -423,11 +423,18 @@ def get_image_id(filename:str) -> int:
423423 >>> no = f"{int(no):04d}"
424424 >>> return int(lv+no)
425425 """
426- raise NotImplementedError ("Create your own 'get_image_id' function" )
427- lv , no = os .path .splitext (os .path .basename (filename ))[0 ].split ("_" )
428- lv = lv .replace ("level" , "" )
429- no = f"{ int (no ):04d} "
430- return int (lv + no )
426+ # raise NotImplementedError("Create your own 'get_image_id' function")
427+ # lv, no = os.path.splitext(os.path.basename(filename))[0].split("_")
428+ # lv = lv.replace("level", "")
429+ # no = f"{int(no):04d}"
430+ # return int(lv+no)
431+
432+ print ("You could also create your own 'get_image_id' function." )
433+ # print(filename)
434+ parts = filename .split ('/' )
435+ id = int (parts [- 1 ][0 :- 4 ])
436+ # print(id)
437+ return id
431438
432439
433440if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments