AaronJackson / vrn

:man: Code for "Large Pose 3D Face Reconstruction from a Single Image via Direct Volumetric CNN Regression"
http://aaronsplace.co.uk/papers/jackson2017recon/
MIT License
4.51k stars 745 forks source link

greyscale conversion error #116

Closed fpradom closed 5 years ago

fpradom commented 5 years ago

Hi Aaron, firsr many thanks for your help in the previous issue.

I am using an of my own grey scale image. In main.lua on line 41 and followings there is a conversion : for i = 1, #fileList do local img = image.load(fileList[i].image) -- Convert grayscale to pseudo-rgb if img:size(1)==1 then img = torch.repeatTensor(img,3,1,1) end On running run.sh i have following error :

[f_prado@localhost vrn]$ ./run.sh Scanning directory for data... Found 1 images 1 images require a face detector Initialising python libs... Initialising detector... Cropped and scaled 5.jpg /home/f_prado/usr/local/torch/install/bin/luajit: ...o/usr/local/torch/install/share/lua/5.1/torch/Tensor.lua:468: Wrong size for view. Input size: 1x192x192. Output size: 1x3x192x192 stack traceback: [C]: in function 'error' ...o/usr/local/torch/install/share/lua/5.1/torch/Tensor.lua:468: in function 'view' process.lua:26: in main chunk [C]: in function 'dofile' ...ocal/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: at 0x004059e0 ls: no se puede acceder a '*.raw': No such file or directory I think there must be a failure in the conversion

AaronJackson commented 5 years ago

It's an issue with the face alignment code I guess. Either save it as a three channel image or modify the code to check if the number of dimensions is 4. If they aren't you need to concat them, as its doing already in the code, and then apply a view. I'm not a maintainer of the face alignment code so I can't push a fix for this.