zigvu / khajuri

Video Pipeline
0 stars 0 forks source link

Error when compressed and uncompressed json folders are compared #84

Closed arpgh closed 9 years ago

arpgh commented 9 years ago

When compressed and uncompressed json folders are given to compare_two_json_folders.py, following error is thrown. Since we can have scores in either form, it'd be helpful to be able to compare them.

Branch: issue78 (error not related to changes in this branch) Video: wc14-NetCos-xtraTm.mkv Path: gpu2:/mnt/data/wc14cls/training/0seed-cleaned/vdo-test/tests-issue78/wc14-NetCos-xtraTm/ Log with error: compareJson-noCuration.csv Json folders used: json-snappy-noCuration & gpu2:/mnt/data/wc14cls/training/0seed-cleaned/vdo-test/wc14-NetCos-xtraTm/json Error:

Traceback (most recent call last):
  File "/home/ubuntu/khajuri/Logo/PipelineTest/compare_two_json_folders.py", line 53, in <module>
    jsonFileComparer = JSONFileComparer(jsonFileName1, jsonFileName2)
  File "/home/ubuntu/khajuri/Logo/PipelineTest/JSONFileComparer.py", line 11, in __init__
    self.jrw2 = JSONReaderWriter(jsonFileName2)
  File "/home/ubuntu/khajuri/Logo/PipelineCore/JSONReaderWriter.py", line 15, in __init__
    snappy.stream_decompress( open( self.fileName, "rb" ), iostr )
IOError: [Errno 2] No such file or directory: '../../wc14-NetCos-xtraTm/json/wc14-NetCos-xtraTm_frame_36426.json.snappy
eacharya commented 9 years ago

Issue: While comparing files across folders, we match their filename to be sure we are reading the information for the right frame. When two folders with different file names (e.g., JSON vs. snappy) are given, the filenames don't match and comparision fails.

Solution: For each JSONReaderWriter.py instance, check to see if .json or .snappy file exists in the specified folder. If it does, read that. Else, throw error.

Tested and marged to Development.