Skip to content

Commit

Permalink
Merge pull request #1761 from pupil-labs/develop
Browse files Browse the repository at this point in the history
v1.20
  • Loading branch information
Patrick Faion authored Dec 12, 2019
2 parents 2342608 + b72307c commit 399e1d9
Show file tree
Hide file tree
Showing 28 changed files with 130 additions and 1,531 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@ mprofile_*.dat
.ipynb_checkpoints/
*.dmg
*.zip
deployment/pupil_v*
*.pyd
*.dll
win_drv
.vs
11 changes: 7 additions & 4 deletions deployment/bundle.bat
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ if not exist %release_dir% (
mkdir %release_dir%
)

call python ..\pupil_src\shared_modules\pupil_detectors\build.py
call python ..\pupil_src\shared_modules\cython_methods\build.py
call python ..\pupil_src\shared_modules\calibration_routines\optimization_calibration\build.py
set PATH=%PATH%;C:\Python36\Lib\site-packages\scipy\.libs
set PATH=%PATH%;C:\Python36\Lib\site-packages\zmq

python ..\pupil_src\shared_modules\pupil_detectors\build.py
python ..\pupil_src\shared_modules\cython_methods\build.py
python ..\pupil_src\shared_modules\calibration_routines\optimization_calibration\build.py

call :Bundle capture %current_tag%
call :Bundle service %current_tag%
Expand All @@ -43,7 +46,7 @@ call :Bundle player %current_tag%
cd %release_dir%
for /d %%d in (*) do (
echo Adding %%d
7z a -t7z ..\%release_dir%.7z %%d
7z a -tzip ..\%release_dir%.zip %%d
)
cd ..

Expand Down
22 changes: 9 additions & 13 deletions deployment/deploy_capture/bundle.spec
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ if platform.system() == "Darwin":
[("pyglui/pupil_icons.ttf", ui.get_pupil_icons_font_path(), "DATA")],
[("pyrealsense/lrs_parsed_classes", pyrealsense_path, "DATA")],
apriltag_libs,
Tree(
"../../pupil_src/shared_modules/calibration_routines/fingertip_calibration/weights/",
prefix="weights",
),
strip=None,
upx=True,
name="Pupil Capture",
Expand Down Expand Up @@ -174,10 +170,6 @@ elif platform.system() == "Linux":
[("pyglui/Roboto-Regular.ttf", ui.get_roboto_font_path(), "DATA")],
[("pyglui/pupil_icons.ttf", ui.get_pupil_icons_font_path(), "DATA")],
apriltag_libs,
Tree(
"../../pupil_src/shared_modules/calibration_routines/fingertip_calibration/weights/",
prefix="weights",
),
strip=True,
upx=True,
name="pupil_capture",
Expand Down Expand Up @@ -211,9 +203,11 @@ elif platform.system() == "Windows":
"scipy.special._ufuncs_cxx",
]

external_libs_path = pathlib.Path("../../pupil_external")

a = Analysis(
["../../pupil_src/main.py"],
pathex=["../../pupil_src/shared_modules/", "../../pupil_external"],
pathex=["../../pupil_src/shared_modules/", str(external_libs_path)],
binaries=None,
datas=None,
hiddenimports=pyglui_hidden_imports
Expand Down Expand Up @@ -246,6 +240,11 @@ elif platform.system() == "Windows":
for lib in apriltag_lib_path.rglob("*.dll")
]

vc_redist_path = external_libs_path / "vc_redist"
vc_redist_libs = [
(lib.name, str(lib), "BINARY") for lib in vc_redist_path.glob("*.dll")
]

coll = COLLECT(
exe,
a.binaries,
Expand All @@ -257,10 +256,7 @@ elif platform.system() == "Windows":
[("pyglui/Roboto-Regular.ttf", ui.get_roboto_font_path(), "DATA")],
[("pyglui/pupil_icons.ttf", ui.get_pupil_icons_font_path(), "DATA")],
apriltag_libs,
Tree(
"../../pupil_src/shared_modules/calibration_routines/fingertip_calibration/weights/",
prefix="weights",
),
vc_redist_libs,
np_dll_list,
strip=False,
upx=True,
Expand Down
22 changes: 9 additions & 13 deletions deployment/deploy_player/bundle.spec
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ if platform.system() == "Darwin":
[("pyglui/Roboto-Regular.ttf", ui.get_roboto_font_path(), "DATA")],
[("pyglui/pupil_icons.ttf", ui.get_pupil_icons_font_path(), "DATA")],
apriltag_libs,
Tree(
"../../pupil_src/shared_modules/calibration_routines/fingertip_calibration/weights/",
prefix="weights",
),
strip=None,
upx=True,
name="Pupil Player",
Expand Down Expand Up @@ -173,10 +169,6 @@ elif platform.system() == "Linux":
[("pyglui/Roboto-Regular.ttf", ui.get_roboto_font_path(), "DATA")],
[("pyglui/pupil_icons.ttf", ui.get_pupil_icons_font_path(), "DATA")],
apriltag_libs,
Tree(
"../../pupil_src/shared_modules/calibration_routines/fingertip_calibration/weights/",
prefix="weights",
),
strip=True,
upx=True,
name="pupil_player",
Expand Down Expand Up @@ -210,9 +202,11 @@ elif platform.system() == "Windows":
"scipy.special._ufuncs_cxx",
]

external_libs_path = pathlib.Path("../../pupil_external")

a = Analysis(
["../../pupil_src/main.py"],
pathex=["../../pupil_src/shared_modules/", "../../pupil_external"],
pathex=["../../pupil_src/shared_modules/", str(external_libs_path)],
hiddenimports=["pyglui.cygl.shader"]
+ scipy_imports
+ av_hidden_imports
Expand Down Expand Up @@ -242,6 +236,11 @@ elif platform.system() == "Windows":
for lib in apriltag_lib_path.rglob("*.dll")
]

vc_redist_path = external_libs_path / "vc_redist"
vc_redist_libs = [
(lib.name, str(lib), "BINARY") for lib in vc_redist_path.glob("*.dll")
]

coll = COLLECT(
exe,
a.binaries,
Expand All @@ -252,10 +251,7 @@ elif platform.system() == "Windows":
[("pyglui/Roboto-Regular.ttf", ui.get_roboto_font_path(), "DATA")],
[("pyglui/pupil_icons.ttf", ui.get_pupil_icons_font_path(), "DATA")],
apriltag_libs,
Tree(
"../../pupil_src/shared_modules/calibration_routines/fingertip_calibration/weights/",
prefix="weights",
),
vc_redist_libs,
np_dll_list,
strip=None,
upx=True,
Expand Down
22 changes: 12 additions & 10 deletions deployment/deploy_service/bundle.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- mode: python -*-


import platform, sys, os, os.path, numpy, glob
import platform, sys, os, os.path, numpy, glob, pathlib

av_hidden_imports = [
"av.format",
Expand Down Expand Up @@ -78,10 +78,6 @@ if platform.system() == "Darwin":
[("pyglui/OpenSans-Regular.ttf", ui.get_opensans_font_path(), "DATA")],
[("pyglui/Roboto-Regular.ttf", ui.get_roboto_font_path(), "DATA")],
[("pyglui/pupil_icons.ttf", ui.get_pupil_icons_font_path(), "DATA")],
Tree(
"../../pupil_src/shared_modules/calibration_routines/fingertip_calibration/weights/",
prefix="weights",
),
strip=None,
upx=True,
name="Pupil Service",
Expand Down Expand Up @@ -140,10 +136,6 @@ elif platform.system() == "Linux":
[("pyglui/OpenSans-Regular.ttf", ui.get_opensans_font_path(), "DATA")],
[("pyglui/Roboto-Regular.ttf", ui.get_roboto_font_path(), "DATA")],
[("pyglui/pupil_icons.ttf", ui.get_pupil_icons_font_path(), "DATA")],
Tree(
"../../pupil_src/shared_modules/calibration_routines/fingertip_calibration/weights/",
prefix="weights",
),
strip=True,
upx=True,
name="pupil_service",
Expand Down Expand Up @@ -177,9 +169,11 @@ elif platform.system() == "Windows":
"scipy.special._ufuncs_cxx",
]

external_libs_path = pathlib.Path("../../pupil_external")

a = Analysis(
["../../pupil_src/main.py"],
pathex=["../../pupil_src/shared_modules/", "../../pupil_external"],
pathex=["../../pupil_src/shared_modules/", str(external_libs_path)],
binaries=None,
datas=None,
hiddenimports=pyglui_hidden_imports + scipy_imports + av_hidden_imports,
Expand All @@ -203,6 +197,13 @@ elif platform.system() == "Windows":
console=False,
resources=["pupil-service.ico,ICON"],
)

vc_redist_path = external_libs_path / "vc_redist"
vc_redist_libs = [
(lib.name, str(lib), "BINARY")
for lib in vc_redist_path.glob("*.dll")
]

coll = COLLECT(
exe,
a.binaries,
Expand All @@ -214,6 +215,7 @@ elif platform.system() == "Windows":
[("pyglui/Roboto-Regular.ttf", ui.get_roboto_font_path(), "DATA")],
[("pyglui/pupil_icons.ttf", ui.get_pupil_icons_font_path(), "DATA")],
np_dll_list,
vc_redist_libs,
strip=False,
upx=True,
name="Pupil Service",
Expand Down
1 change: 0 additions & 1 deletion docs/dependencies-macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ pip install pyaudio
pip install pyopengl
pip install pyzmq
pip install scipy
pip install torch torchvision
pip install git+https://github.com/zeromq/pyre

pip install pupil_apriltags
Expand Down
1 change: 0 additions & 1 deletion docs/dependencies-ubuntu17.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ pip install pyaudio
pip install pyopengl
pip install pyzmq
pip install scipy
pip install torch torchvision
pip install git+https://github.com/zeromq/pyre

pip install pupil_apriltags
Expand Down
1 change: 0 additions & 1 deletion docs/dependencies-ubuntu18.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ pip install pyaudio
pip install pyopengl
pip install pyzmq
pip install scipy
pip install torch torchvision
pip install git+https://github.com/zeromq/pyre

pip install pupil_apriltags
Expand Down
5 changes: 0 additions & 5 deletions docs/dependencies-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ pip install git+https://github.com/pupil-labs/nslr
pip install git+https://github.com/pupil-labs/nslr-hmm
```

Now install pytorch:
- Open the pytorch website for local installation: https://pytorch.org/get-started/locally/
- Select options: Stable, Windows, Pip, Python 3.6, CUDA 9.0.
- You will be provided with two commands. Run them in the order given to install the wheels.

## Pupil Labs Python Wheels

In addition to these libraries, you will need to install some Pupil-Labs support libraries. Since building them for Windows is also not automated yet, we provide some prebuilt wheels that you can use. If you want to build the support libraries yourself as well, you will have to look for install instructions on the respective GitHub repositories.
Expand Down
5 changes: 5 additions & 0 deletions pupil_external/vc_redist/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This folder includes dlls that have been extracted from vc_redist.x64.exe to fix https://github.com/pupil-labs/pupil/issues/1661

Specifically, one needs:
- concrt140.dll
- vcomp140.dll
4 changes: 3 additions & 1 deletion pupil_src/launchables/eye.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,14 +878,15 @@ def eye_profiled(
version,
eye_id,
overwrite_cap_settings=None,
hide_ui=False,
):
import cProfile
import subprocess
import os
from .eye import eye

cProfile.runctx(
"eye(timebase, is_alive_flag,ipc_pub_url,ipc_sub_url,ipc_push_url, user_dir, version, eye_id, overwrite_cap_settings)",
"eye(timebase, is_alive_flag,ipc_pub_url,ipc_sub_url,ipc_push_url, user_dir, version, eye_id, overwrite_cap_settings, hide_ui)",
{
"timebase": timebase,
"is_alive_flag": is_alive_flag,
Expand All @@ -896,6 +897,7 @@ def eye_profiled(
"version": version,
"eye_id": eye_id,
"overwrite_cap_settings": overwrite_cap_settings,
"hide_ui": hide_ui,
},
locals(),
"eye{}.pstats".format(eye_id),
Expand Down
6 changes: 5 additions & 1 deletion pupil_src/launchables/marker_detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ def circle_detector(ipc_push_url, pair_url, source_path, batch_size=20):
from circle_detector import CircleTracker

try:
src = File_Source(SimpleNamespace(), source_path, timing=None)
# TODO: we need fill_gaps=True for correct frame indices to paint the circle
# markers on the world stream. But actually we don't want to process gap frames
# with the marker detector. We should make an option to only receive non-gap
# frames, but with gap-like indices?
src = File_Source(SimpleNamespace(), source_path, timing=None, fill_gaps=True)

frame = src.get_frame()
logger.info("Starting calibration marker detection...")
Expand Down
4 changes: 3 additions & 1 deletion pupil_src/launchables/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,13 @@ def service_profiled(
user_dir,
version,
preferred_remote_port,
hide_ui,
):
import cProfile, subprocess, os
from .service import service

cProfile.runctx(
"service(timebase,eye_procs_alive,ipc_pub_url,ipc_sub_url,ipc_push_url,user_dir,version)",
"service(timebase,eye_procs_alive,ipc_pub_url,ipc_sub_url,ipc_push_url,user_dir,version,preferred_remote_port,hide_ui)",
{
"timebase": timebase,
"eye_procs_alive": eye_procs_alive,
Expand All @@ -349,6 +350,7 @@ def service_profiled(
"user_dir": user_dir,
"version": version,
"preferred_remote_port": preferred_remote_port,
"hide_ui": hide_ui,
},
locals(),
"service.pstats",
Expand Down
4 changes: 3 additions & 1 deletion pupil_src/launchables/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,14 +756,15 @@ def world_profiled(
user_dir,
version,
preferred_remote_port,
hide_ui,
):
import cProfile
import subprocess
import os
from .world import world

cProfile.runctx(
"world(timebase, eye_procs_alive, ipc_pub_url,ipc_sub_url,ipc_push_url,user_dir,version,preferred_remote_port)",
"world(timebase, eye_procs_alive, ipc_pub_url,ipc_sub_url,ipc_push_url,user_dir,version,preferred_remote_port, hide_ui)",
{
"timebase": timebase,
"eye_procs_alive": eye_procs_alive,
Expand All @@ -773,6 +774,7 @@ def world_profiled(
"user_dir": user_dir,
"version": version,
"preferred_remote_port": preferred_remote_port,
"hide_ui": hide_ui,
},
locals(),
"world.pstats",
Expand Down
2 changes: 0 additions & 2 deletions pupil_src/shared_modules/calibration_routines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# import detector classes from sibling files
from .screen_marker_calibration import Screen_Marker_Calibration
from .manual_marker_calibration import Manual_Marker_Calibration
from .fingertip_calibration import Fingertip_Calibration
from .single_marker_calibration import Single_Marker_Calibration
from .natural_features_calibration import Natural_Features_Calibration
from .hmd_calibration import HMD_Calibration, HMD_Calibration_3D
Expand All @@ -30,7 +29,6 @@
calibration_plugins = [
Screen_Marker_Calibration,
Manual_Marker_Calibration,
Fingertip_Calibration,
Single_Marker_Calibration,
Natural_Features_Calibration,
HMD_Calibration,
Expand Down

This file was deleted.

Loading

0 comments on commit 399e1d9

Please sign in to comment.