Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnboundLocalError: local variable 'au25' referenced before assignment #1

Open
MahlerMozart opened this issue Jan 4, 2025 · 2 comments

Comments

@MahlerMozart
Copy link

Thank you for your great work! I followed the instruction and train the model with May.mp4, however, I encountered the no AU25 error. Any idea how it happened?

bash scripts/train_xx.sh data/may output/may 0
Optimizing output/may
Output folder: output/may [03/01 23:11:46]
Pre-Embedding of 32 dimensions [03/01 23:11:46]
Found transforms_train.json file, assuming Blender data set! [03/01 23:11:46]
Reading Training Transforms [03/01 23:11:46]
No AU25 [03/01 23:11:46]

and later the error shows here.

File "/home/xxx/Documents/DEGSTalk/scene/dataset_readers.py", line 162, in readCamerasFromTransforms
au25 = np.clip(au25, 0, np.percentile(au25, 95))
UnboundLocalError: local variable 'au25' referenced before assignment

@Kedreamix
Copy link
Collaborator

I'm sorry to hear that you've encountered issues obtaining the au csv data.

try:
au_blink = au_info['AU45_r'].values
au25 = au_info['AU25_r'].values
except:
print('No AU25')

To correctly obtain it, you need to run "FeatureExtraction" in OpenFace. After that, rename the output CSV file and move it to the path "data//au.csv".

Please double - check if you've followed each step correctly.

@1400013531
Copy link

I encountered the same problem after I put the au.csv generated by OpenFace in data/project_name/. But I found the key in au.csv is ' AU45_r', with a initial space before the 'AU_45' . So I add skipinitialspace option to the read_csv in line 156 of dataset_readers.py like : au_info=pd.read_csv(os.path.join(path, 'au.csv'), skipinitialspace=True).

# https://imotions.com/blog/learning/research-fundamentals/facial-action-coding-system/
au_info=pd.read_csv(os.path.join(path, 'au.csv'))
try:
au_blink = au_info['AU45_r'].values
au25 = au_info['AU25_r'].values

It worked for me!

Thank you for your great work! I followed the instruction and train the model with May.mp4, however, I encountered the no AU25 error. Any idea how it happened?

bash scripts/train_xx.sh data/may output/may 0 Optimizing output/may Output folder: output/may [03/01 23:11:46] Pre-Embedding of 32 dimensions [03/01 23:11:46] Found transforms_train.json file, assuming Blender data set! [03/01 23:11:46] Reading Training Transforms [03/01 23:11:46] No AU25 [03/01 23:11:46]

and later the error shows here.

File "/home/xxx/Documents/DEGSTalk/scene/dataset_readers.py", line 162, in readCamerasFromTransforms au25 = np.clip(au25, 0, np.percentile(au25, 95)) UnboundLocalError: local variable 'au25' referenced before assignment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants