You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm using the auto_delin function with the dlib70 model.
I wrote this wrapper function:
get_individually_aligned_faces<-function(x)
{
stimuli<- read_stim(path=x$path, pattern= c("-A\\.","-HC\\.","-HO\\.","-N\\.","-S\\.")) # filter out "NM" (neutral with covid mask) images, by providing specific patternsface_model<- auto_delin(stimuli, "dlib70", replace=F) # get faces dlib70 model dtmp<- draw_tem(face_model) |> plot() # draw face template from modelpatch_fill<- patch(face_model, width=1, height=10) # get the background color of the face image, to be used when adjusting the face locationhorized<-face_model|> horiz_eyes(fill=patch_fill) # align by eyeshorized_plot<-horized|> plot()
aligned<-face_model|> horiz_eyes(fill=patch_fill) |> align(procrustes=TRUE, fill=patch_fill) # align using procrustes (average location of all images)aligned_plot<-aligned|> plot()
stim_list<-list(fm=face_model,tmp=dtmp,hrz=horized,hrzplot=horized_plot,alg=aligned,algplot=aligned_plot) # save everything
}
And I'm calling it for different subsets of images using purrr::map (actually, within each subset, I have 4 or 5 images for each face identify that are saved in the same directory and are called from the same path on each run of my function).
For some reason, the auto_delin function runs fine for some subsets of images, but not for others. I'm getting the following error, suggesting there's a problem with creating a matrix for some of the images (in this case, image F-061):
Error in mutate():
! Problem while computing params = purrr::map(.x = data, .f = ~get_individually_aligned_faces(.x)).
ℹ The error occurred in group 10: image_id = "F-061".
Caused by error in purrr::map():
ℹ In index: 1.
Caused by error in matrix():
! length of 'dimnames' [2] not equal to array extent
Backtrace:
All images come from the same database (the subsetting is just for easier debugging) and are of the same file type (JPG). Within each subset, there are the same number of files (either 4 or 5) per face identity.
Any suggestions?
Thanks.
The text was updated successfully, but these errors were encountered:
More info: when calling read_stim for images for which auto_delin works properly, I'm getting a stimlist of 5 elements: imagepath, desc (with a binary comment that produces a warning message), width, and height. For images for which auto_delin does not work, I'm getting 4 elements (no 'desc'). Is that important in some way?
Hi,
I'm using the auto_delin function with the dlib70 model.
I wrote this wrapper function:
And I'm calling it for different subsets of images using purrr::map (actually, within each subset, I have 4 or 5 images for each face identify that are saved in the same directory and are called from the same path on each run of my function).
For some reason, the auto_delin function runs fine for some subsets of images, but not for others. I'm getting the following error, suggesting there's a problem with creating a matrix for some of the images (in this case, image F-061):
Error in
mutate()
:! Problem while computing
params = purrr::map(.x = data, .f = ~get_individually_aligned_faces(.x))
.ℹ The error occurred in group 10: image_id = "F-061".
Caused by error in
purrr::map()
:ℹ In index: 1.
Caused by error in
matrix()
:! length of 'dimnames' [2] not equal to array extent
Backtrace:
All images come from the same database (the subsetting is just for easier debugging) and are of the same file type (JPG). Within each subset, there are the same number of files (either 4 or 5) per face identity.
Any suggestions?
Thanks.
The text was updated successfully, but these errors were encountered: