s885219s / Gaze_Manipulation

Implement DeepWarp algorithm for gaze manipulation
14 stars 7 forks source link

DeepWarp.py is Missing #1

Open mehulmodihb opened 6 years ago

mehulmodihb commented 6 years ago

Hi, I was trying your code but unfortunately "DeepWarp.py" file is missing. can you please provide me DeepWarp.py?

s885219s commented 6 years ago

Hi, thank you for your reminder. I implemented DeepWarp just for practicing deep learning framework and for fun, so the code is very ugly. Sorry for that.

mehulmodihb commented 6 years ago

Hi Again,

When I tried to run your code. I got following error. can you please help me with it?

Using TensorFlow backend.

Traceback (most recent call last): File "_call_me_by_php---lasdF8wer2aLsdkfj.py", line 47, in model_L = create_model(input_img, input_agl, input_ef, conf, cfw_only = False) File "/Users/hb1/Desktop/Projects/Python/gaze_manipulation/DeepWarp.py", line 35, in create_model locnet = BatchNormalization()(locnet) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/keras/engine/topology.py", line 617, in call output = self.call(inputs, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/keras/layers/normalization.py", line 181, in call epsilon=self.epsilon) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 1818, in normalize_batch_in_training if not _has_nchw_support() and list(reduction_axes) == [0, 2, 3]: File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 281, in _has_nchw_support explicitly_on_cpu = _is_current_explicit_device('CPU') File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 256, in _is_current_explicit_device device = _get_current_tf_device() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 237, in _get_current_tf_device g._apply_device_functions(op) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3752, in _apply_device_functions op._set_device(device_function(op)) # pylint: disable=protected-access File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/framework/device.py", line 284, in _device_function current_device = DeviceSpec.from_string(node_def.device or "") File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/framework/device.py", line 228, in from_string return DeviceSpec().parse_from_string(spec) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/framework/device.py", line 146, in parse_from_string splits = [x.split(":") for x in spec.split("/")] AttributeError: 'DeviceSpec' object has no attribute 'split'

mehulmodihb commented 6 years ago

Hi,

I found you used "FaceLandmarkImg.exe" but how can i use this project on linux or Mac OS?

s885219s commented 6 years ago

Hi, I will create a new branch for Linux version, thx.

s885219s commented 6 years ago

Hi, I have just uploaded the Linux version. If you have any error about "FaceLandmarkImg", you may checkout the Unix Installation of OpenFace to install the dependencies.

By the way, this code were written in Python3, the errors you got above seems that you were using Python2.7.

mehulmodihb commented 6 years ago

Hi,

Thank you for your positive response. I tried the Linux branch with Python 3 but getting following error.

Exception in thread looking_thread: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916, in bootstrap_inner self.run() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 864, in run self.target(self._args, self._kwargs) File "gaze_manipulation_thread.py", line 93, in look_new_images eyes_array = get_feature_points(img_path) File "gaze_manipulation_thread.py", line 157, in get_feature_points eyes_params = subprocess.check_output(['./openface/bin/FaceLandmarkImg', '-f', img_path, '-gaze'], universal_newlines=True) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 336, in check_output kwargs).stdout File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 403, in run with Popen(popenargs, **kwargs) as process: File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 707, in __init restore_signals, start_new_session) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1333, in _execute_child raise child_exception_type(errno_num, err_msg) PermissionError: [Errno 13] Permission denied

s885219s commented 6 years ago

Hi, go to the path with FaceLandmarkImg. Simply type cd openface/bin from the root, and then type chmod 777 FaceLandmarkImg. I think it will solve the PermissionError.

Also, you can check out the demo on http://140.109.22.211/gaze/.

s885219s commented 6 years ago

Make sure to upload the picture with clear face and eye, or it might not be able to detect the location of eyes.

mehulmodihb commented 6 years ago

Hi,

I changed permission and I am getting following error now.

OSError: [Errno 8] Exec format error: './openface/bin/FaceLandmarkImg'

Also, Please find attached file which i am using now. rex

s885219s commented 6 years ago

Okay...I think I can replace the FaceLandmarkImg part by other eye detection API. On the other hand, the author of DeepWarp did not release their training image dataset. As the result, it is really difficult to reproduce the performance which showed on the paper. The picture with the eyes on the same horizontal will have the better performance. Something like this http://amsterdam-ftv-blog.com/wp-content/uploads/2013/10/20131024-220300.jpg