Skip to content

Lines added for eye tracking in importIitYarp.py causing an error during file import #54

@Melica101

Description

@Melica101

While trying to import an events file, bimvee returns the following error:

Traceback (most recent call last):
File "C:\Users\mo.ali\Documents\the\hpe-core\example\movenet\bim_test.py", line 36, in
data_dvs = import_file(input_data_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mo.ali\Documents\the\hpe-core\example\movenet\bim_test.py", line 14, in import_file
data_dvs = import_dvs(filePathOrName=data_dvs_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mo.ali\Documents\the\hpe-core\example\movenet\venv\Lib\site-packages\bimvee\importIitYarp.py", line 842, in importIitYarp
importedDicts = importIitYarpRecursive(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mo.ali\Documents\the\hpe-core\example\movenet\venv\Lib\site-packages\bimvee\importIitYarp.py", line 821, in importIitYarpRecursive
if eyes is not None:
^^^^
UnboundLocalError: cannot access local variable 'eyes' where it is not associated with a value

Eventually, the error was fixed by commenting out the following lines of code in importIitYarp.py for this usecase.

if eyes is not None:
addGroundTruth(eyes, importedDicts, 'eyeTracking')

Code to reproduce the error

import os
import numpy as np
from bimvee.importIitYarp import importIitYarp as import_dvs
from bimvee.importIitYarp import importIitYarpBinaryDataLog

def import_file(data_dvs_file):
    filename = os.path.basename(data_dvs_file)
    if filename == 'binaryevents.log':
        data_dvs = importIitYarpBinaryDataLog(filePathOrName=data_dvs_file)
    else:
        data_dvs = import_dvs(filePathOrName=data_dvs_file)
    print('File imported.')
    return data_dvs

input_data_dir = os.path.abspath("data/cam2_S9_Eating/ch0dvs/")
data_dvs = import_file(input_data_dir)
print(data_dvs)

The event data is taken from public_datasets\H36M\Different_formats\Version1-cropped\EV2\cam2_S9_Eating\ch0dvs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions