{"action":"opened","issue":{"url":"https://api.github.com/repos/cmusatyalab/openface/issues/24","labels_url":"https://api.github.com/repos/cmusatyalab/openface/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/cmusatyalab/openface/issues/24/comments","events_url":"https://api.github.com/repos/cmusatyalab/openface/issues/24/events","html_url":"https://github.com/cmusatyalab/openface/issues/24","id":112073901,"number":24,"title":"Facing issues in forwardPath","user":{"login":"Prithviraj7","id":8354330,"avatar_url":"https://avatars.githubusercontent.com/u/8354330?v=3","gravatar_id":"","url":"https://api.github.com/users/Prithviraj7","html_url":"https://github.com/Prithviraj7","followers_url":"https://api.github.com/users/Prithviraj7/followers","following_url":"https://api.github.com/users/Prithviraj7/following{/other_user}","gists_url":"https://api.github.com/users/Prithviraj7/gists{/gist_id}","starred_url":"https://api.github.com/users/Prithviraj7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Prithviraj7/subscriptions","organizations_url":"https://api.github.com/users/Prithviraj7/orgs","repos_url":"https://api.github.com/users/Prithviraj7/repos","events_url":"https://api.github.com/users/Prithviraj7/events{/privacy}","received_events_url":"https://api.github.com/users/Prithviraj7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-19T05:20:55Z","updated_at":"2015-10-19T05:20:55Z","closed_at":null,"body":"I am trying to use the exemplar code given under 'Usage' in the readme document.  This is the code which I'm using.\r\n``` python\r\nparser.add_argument('--dlibFaceMean', type=str, help=\"Path to dlib's face predictor.\",\r\n                    default=os.path.join(dlibModelDir, \"mean.csv\"))\r\nparser.add_argument('--dlibFacePredictor', type=str, help=\"Path to dlib's face predictor.\",\r\n                    default=os.path.join(dlibModelDir, \"shape_predictor_68_face_landmarks.dat\"))\r\nparser.add_argument('--networkModel', type=str, help=\"Path to Torch network model.\",\r\n                    default=os.path.join(openfaceModelDir, 'nn4.v1.t7'))\r\nparser.add_argument('--imgDim', type=int,\r\n                    help=\"Default image dimension.\", default=96)\r\nparser.add_argument('--cuda', action='store_true')\r\nargs = parser.parse_args()\r\nprint args\r\n\r\nalign = NaiveDlib(args.dlibFaceMean, args.dlibFacePredictor)\r\nprint args.dlibFaceMean\r\nprint args.dlibFacePredictor\r\nnet = openface.TorchWrap(args.networkModel, imgDim=args.imgDim, cuda=args.cuda)\r\nprint align\r\nimg = cv2.imread('Andrew-Ng-Photo.jpg')\r\nbb = align.getLargestFaceBoundingBox(img)\r\nalignedFace = align.alignImg(\"affine\", args.imgDim, img, bb)\r\n\r\nprint args.imgDim\r\nprint alignedFace.shape\r\nprint bb\r\nrep1 = net.forwardImage(alignedFace)\r\n```\r\n \r\nBut I'm getting error in this line.\r\n<code>rep1 = net.forwardImage(alignedFace)</code>\r\n\r\nThis is the error:\r\n\r\n```\r\n rep1 = net.forwardImage(alignedFace)\r\n  File \"/home/prithviraj/openface/openface/__init__.py\", line 80, in forwardImage\r\n    rep = np.array(self.forwardPath(t))\r\n  File \"/home/prithviraj/openface/openface/__init__.py\", line 73, in forwardPath\r\n    return [float(x) for x in self.p.stdout.readline().strip().split(',')]\r\nValueError: could not convert string to float:\r\n```\r\nI traced it back and found that the problem is in <code>/openface/openface/__init.py__</code>. \r\n\r\nSo I decided to modify the forwardPath and forwardImage functions in __init.py__.\r\n``` python\r\ndef forwardPath(self, imgPath):\r\n        print imgPath\r\n        self.p.stdin.write(imgPath + \"\\n\")\r\n        print [(x) for x in self.p.stdout.readline().strip().split(',')]\r\n        return [float(x) for x in self.p.stdout.readline().strip().split(',')]\r\n\r\n    def forwardImage(self, rgb):\r\n        print rgb.shape\r\n        t = '/tmp/openface-torchwrap-{}.png'.format(\r\n            binascii.b2a_hex(os.urandom(8)))\r\n        cv2.imwrite(t, rgb)\r\n        rep = np.array(self.forwardPath(t))\r\n        os.remove(t)\r\n        return rep\r\n   ``` \r\n\r\nHere, I found out that this line \r\n``` python \r\nprint [(x) for x in self.p.stdout.readline().strip().split(',')]\r\n ``` \r\nreturns an empty list, which results in the error. Please help me with this isssue.\r\nTIA\r\n\r\n"}}