video_to_bvh icon indicating copy to clipboard operation
video_to_bvh copied to clipboard

Error Due to string literal in File Name

Open ashwath98 opened this issue 4 years ago • 5 comments

One of the errors that occur in step 3 is the following (Process the video )

File "hmr/demo.py", line 194, in all_files.sort(key=lambda x: int(x.split('/')[-1].split('.')[0])) ValueError: invalid literal for int() with base 10: 'abc002'

which is due to the input file name being abc, which causes the error during conversion in the lambda function

to fix this what is the suggested action?

  1. Should I change the file name to some integer only? But if I assign an integer value that might mess up the sort function as all filenames will be prefixed with that integer value OR I can name the input file as '0'
  2. I can remove the part where the filename is added to the number during the CSV file generation

Also to make the code compatible with tf 1.15 I had to make some small changes to config.py, batch_lbs.py and models.py in your hmr repo, should I make a PR describing that? ( I don't think it is needed it's only 4 changes)

ashwath98 avatar Feb 26 '20 09:02 ashwath98

Had the same issue, so it happened that "all_files" was already sorted at this point, so simply commented out #all_files.sort. But I guess it's not something to count on for always happening, as it's probably a file-system / platform dependent thing :/

Norod avatar Mar 11 '20 15:03 Norod

I commented out #all_files.sort but then when i open the bvh file, the motion capture data is completely out of order. Did you ever figure out a different solution besides just commenting out?

danielcitron avatar Apr 16 '20 04:04 danielcitron

Change the filename to an integer

ashwath98 avatar Apr 16 '20 05:04 ashwath98

Did you ever figure out a different solution besides just commenting out?

I didn't try

Norod avatar Apr 16 '20 20:04 Norod

just remove the int from the all_files sort line like this "all_files.sort(key=lambda x: x.split('/')[-1].split('.')[0])".It will work fine

amar8600 avatar Sep 09 '20 10:09 amar8600