Closed chinmaynehate closed 3 years ago
This change should preserve the required columns for celeb and solve this issue.
Hey,
For CelebDF-V2 dataset,
I used the latest code to create the faces dataframe for celebdf. The issue of 'test' field has been solved. But now I am getting KeyError for 'original' field.
You can verify this by running:
import pandas as pd
df = pd.read_pickle("facesdf/faces_df.pkl")
print(df['original'])
print("\n")
print(df["test"])
I don't know why but:
If you remove 'original' from fields_to_preserve_from_video
list line 190 of extract_faces.py, and rerun the code(extract_faces.py), we get both the 'original' and 'test' fields in the faces dataframe.
Thank you
That's strange. Did you remove the old faces_df.pkl
and re-run the latest code? Does the error show up in the exact same way as before, but with original
field instead of test
?
Hey,
Did you remove the old faces_df.pkl and re-run the latest code?
Yes I deleted the faces_df.pkl file before re-running the latest code.
Does the error show up in the exact same way as before, but with original field instead of test?
Yes
When I read the faces dataframe and print(df['original']) using the latest code: I get KeyError: 'original'
But 'test' field is present which I verified by print(df['test'])
On the other hand, if I remove 'original' from the list, I get the original and test fields.
>>> df['original']
facepath
Celeb-real/id58_0003.mp4/fr000_subj0.jpg -1
Celeb-real/id58_0003.mp4/fr016_subj0.jpg -1
Celeb-real/id58_0003.mp4/fr032_subj0.jpg -1
Celeb-real/id58_0003.mp4/fr048_subj0.jpg -1
Celeb-real/id58_0003.mp4/fr064_subj0.jpg -1
..
YouTube-real/00192.mp4/fr411_subj0.jpg -1
YouTube-real/00192.mp4/fr427_subj0.jpg -1
YouTube-real/00192.mp4/fr442_subj0.jpg -1
YouTube-real/00192.mp4/fr457_subj0.jpg -1
YouTube-real/00192.mp4/fr473_subj0.jpg -1
Name: original, Length: 208840, dtype: int64
>>> df['test']
facepath
Celeb-real/id58_0003.mp4/fr000_subj0.jpg False
Celeb-real/id58_0003.mp4/fr016_subj0.jpg False
Celeb-real/id58_0003.mp4/fr032_subj0.jpg False
Celeb-real/id58_0003.mp4/fr048_subj0.jpg False
Celeb-real/id58_0003.mp4/fr064_subj0.jpg False
...
YouTube-real/00192.mp4/fr411_subj0.jpg False
YouTube-real/00192.mp4/fr427_subj0.jpg False
YouTube-real/00192.mp4/fr442_subj0.jpg False
YouTube-real/00192.mp4/fr457_subj0.jpg False
YouTube-real/00192.mp4/fr473_subj0.jpg False
Name: test, Length: 208840, dtype: bool
This commit should fix the issue, please try to repeat the steps and let us know if you succedeed
Hey,
Yes. The issue is solved.
Thank you
Hey,
For Celeb-DF V2 dataset: (EfficientNetB4ST) _I first ran the index_celebdf.py and extractfaces.py and got the faces and dataframe of faces.
After that,
I made the following changes in train_triplet.py:
make_splits()
function at line 226 of train_triplet.py corresponding to celebdf faces and dataframe of celebdf facesload_df()
function at line 28 of isplutils/split.py to read the celebdf faces dataframeAfter this, I ran train_triplet.py using: (running for 2 iterations only)
python3 train_triplet.py --net EfficientNetB4 --traindb celebdf --valdb celebdf --celebdf_faces_df_path facesdf/faces_df.pkl --celebdf_faces_dir faces/ --face scale --size 224 --workers 0 --traintriplets 70 --valtriplets 20 --maxiter 2 --valint 1
Output:
In short: At line 91 of isplutils/split.py I am getting a KeyError for df['test']. There is no 'test' field in the dataframe of celebdf faces. You can verify this by running:(for celeb-df dataset)
_I was able to run the code(traintriplet.py) by removing (df['test'] == False) at line 91 of isplutils/split.py
_I did similar changes for trainbinclass.py and was able to train the model using it as well.
After this: While running test_model.py for celebdf, again I got the KeyError for 'test' while making a test split at line 99 of isplutils/split.py
Any way to solve this while running the test_model.py code?
Thank you