chihfanhsu / gaze_correction

Correcting gaze by warping-based convolutional neural network in live video communication
283 stars 54 forks source link

Feature Request: Support for MacOS (Linux?) #10

Closed LoSunny closed 3 years ago

LoSunny commented 3 years ago

Can you add support apart from Windows? It would be great!

christf commented 3 years ago

(looking for Linux support here)

chihfanhsu commented 3 years ago

I think the python codes are easy to adapt to Linux OS. All you need is to change the environment setting.

christf commented 3 years ago

it shouldn't be too difficult I agree - and the win32api dependency must be replaced by something portable.

chihfanhsu commented 3 years ago

For the location of the window. You may consider this post (Get window position & size with python), which mentions that if you're using Mac OS X, you could try using appscript; for Linux, you can try one of the many interfaces to X11 Link.

LoSunny commented 3 years ago

I've tried to replace the win32api with the values set directly, here is my fork https://github.com/LoYungSum/gaze_correction_loyungsum

But when I try to run the script, there is no window popup nor any error

(gaze_correction) sunnylo@SunnyLos-MacBook-Air gaze_correction_system % python3 regz_socket_MP_FD.py
Namespace(P_IDP=6.3, P_c_x=0, P_c_y=-9.5, P_c_z=-1, S_H=18, S_W=28.5, agl_dim=2, channel=3, ef_dim=12, encoded_agl_dim=16, f=1000, height=48, mod='flx', record_time=False, recver_port=5005, sender_port=5005, tar_ip='localhost', uid='local', weight_set='weights', width=64)
(1400, 900)
Socket created
Socket now listening
Loading model of [L] eye to GPU
WARNING:tensorflow:From regz_socket_MP_FD.py:155: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING:tensorflow:From /Users/sunnylo/Desktop/tensorflow/gaze_correction/gaze_correction_system/flx.py:57: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.

WARNING:tensorflow:From /Users/sunnylo/Desktop/tensorflow/gaze_correction/gaze_correction_system/tf_utils.py:23: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.Dense instead.
WARNING:tensorflow:From /Users/sunnylo/.pyenv/versions/gaze_correction/lib/python3.7/site-packages/tensorflow_core/python/layers/core.py:187: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.
Instructions for updating:
Please use `layer.__call__` method instead.
WARNING:tensorflow:From /Users/sunnylo/Desktop/tensorflow/gaze_correction/gaze_correction_system/flx.py:63: average_pooling2d (from tensorflow.python.layers.pooling) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.AveragePooling2D instead.
WARNING:tensorflow:From /Users/sunnylo/Desktop/tensorflow/gaze_correction/gaze_correction_system/tf_utils.py:16: conv2d (from tensorflow.python.layers.convolutional) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.keras.layers.Conv2D` instead.
WARNING:tensorflow:From /Users/sunnylo/Desktop/tensorflow/gaze_correction/gaze_correction_system/tf_utils.py:10: batch_normalization (from tensorflow.python.layers.normalization) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.BatchNormalization instead.  In particular, `tf.control_dependencies(tf.GraphKeys.UPDATE_OPS)` should not be used (consult the `tf.keras.layers.batch_normalization` documentation).
WARNING:tensorflow:From /Users/sunnylo/Desktop/tensorflow/gaze_correction/gaze_correction_system/flx.py:66: The name tf.image.resize_images is deprecated. Please use tf.image.resize instead.

WARNING:tensorflow:From regz_socket_MP_FD.py:163: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

WARNING:tensorflow:From regz_socket_MP_FD.py:163: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

2020-12-08 14:29:27.085510: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-12-08 14:29:27.177706: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7ff59b258390 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-12-08 14:29:27.178056: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
WARNING:tensorflow:From regz_socket_MP_FD.py:165: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead.

WARNING:tensorflow:From regz_socket_MP_FD.py:165: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.

Loading model of [R] eye to GPU
payload_size: 8
objc[87660]: +[AVCaptureDevice initialize] may have been in progress in another thread when fork() was called.
objc[87660]: +[AVCaptureDevice initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.