From 8f50147361581378ad9c2a4cce77422f7a31803b Mon Sep 17 00:00:00 2001 From: anshu957 <32687084+anshu957@users.noreply.github.com> Date: Tue, 18 Apr 2023 13:54:13 -0400 Subject: [PATCH 1/6] fix for window not responding in apple silicon known bug: https://bugreports.qt.io/browse/QTBUG-87014 solution: https://stackoverflow.com/questions/64818879/is-there-any-solution-regarding-to-pyqt-library-doesnt-work-in-mac-os-big-sur --- app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.py b/app.py index 614173e..cdcc009 100755 --- a/app.py +++ b/app.py @@ -6,6 +6,11 @@ import argparse import sys +#### For Mac M1 compatibility ###### +import os +os.environ['QT_MAC_WANTS_LAYER'] = '1' +#################################### + from PySide2 import QtWidgets from src import APP_NAME, APP_NAME_LONG From f3f8a7826e163a731d9f746a8fb232a8f9413feb Mon Sep 17 00:00:00 2001 From: anshu957 <32687084+anshu957@users.noreply.github.com> Date: Tue, 18 Apr 2023 13:54:57 -0400 Subject: [PATCH 2/6] Update requirements.txt sklearn is depreciated (using scikit-learn) --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e388632..b7ba62a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,6 @@ scipy==1.6.1 Shapely==1.7.1 shiboken2==5.15.2 six==1.14.0 -sklearn==0.0 tabulate==0.8.8 threadpoolctl==2.1.0 unittest-xml-reporting==3.0.2 From 06be4b32411b73aee3162e795fbed52d44216d24 Mon Sep 17 00:00:00 2001 From: anshu957 <32687084+anshu957@users.noreply.github.com> Date: Mon, 24 Apr 2023 17:59:46 -0400 Subject: [PATCH 3/6] added conda environment file Conda based installation works better in apple silicon. Have tested this on two different mac M1/M2 arm based architectures. --- environment_jabs.yml | 86 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 environment_jabs.yml diff --git a/environment_jabs.yml b/environment_jabs.yml new file mode 100644 index 0000000..acf54f6 --- /dev/null +++ b/environment_jabs.yml @@ -0,0 +1,86 @@ +name: jabs +channels: + - conda-forge + - defaults +dependencies: + - bzip2=1.0.8=h3422bc3_4 + - ca-certificates=2022.12.7=h4653dfc_0 + - gettext=0.21.1=h0186832_0 + - giflib=5.2.1=h1a8c8d9_3 + - glib=2.76.1=hb5ab8b9_0 + - glib-tools=2.76.1=hb5ab8b9_0 + - gst-plugins-base=1.21.3=h8b7775e_1 + - gstreamer=1.21.3=hcb7b3dd_1 + - icu=70.1=h6b3803e_0 + - jpeg=9e=h1a8c8d9_3 + - krb5=1.19.3=he492e65_0 + - lerc=4.0.0=h9a09cb3_0 + - libclang=15.0.7=default_h9e54d93_1 + - libclang13=15.0.7=default_h7d574e7_1 + - libcxx=16.0.1=h75e25f2_0 + - libdeflate=1.17=h1a8c8d9_0 + - libedit=3.1.20191231=hc8eb9b7_2 + - libffi=3.4.2=h3422bc3_5 + - libglib=2.76.1=h4646484_0 + - libiconv=1.17=he4db4b2_0 + - libllvm15=15.0.7=h62b9111_1 + - libogg=1.3.4=h27ca646_1 + - libopus=1.3.1=h27ca646_1 + - libpng=1.6.39=h76d750c_0 + - libpq=15.1=h998ac43_1 + - libsqlite=3.40.0=h76d750c_0 + - libtiff=4.5.0=h5dffbdd_2 + - libvorbis=1.3.7=h9f76cd9_0 + - libwebp=1.2.4=h999c80f_1 + - libwebp-base=1.2.4=h1a8c8d9_0 + - libxml2=2.10.3=h67585b2_4 + - libxslt=1.1.37=h1bd8bc4_0 + - libzlib=1.2.13=h03a7124_4 + - mysql-common=8.0.32=h518ea0a_1 + - mysql-libs=8.0.32=hcb599eb_1 + - ncurses=6.3=h07bb92c_1 + - nspr=4.35=hb7217d7_0 + - nss=3.89=h789eff7_0 + - openssl=3.1.0=h03a7124_0 + - packaging=23.1=pyhd8ed1ab_0 + - pcre2=10.40=hb34f9b4_0 + - pip=23.1=pyhd8ed1ab_0 + - ply=3.11=py_1 + - pyqt=5.15.7=py310h7aaa74b_3 + - pyqt5-sip=12.11.0=py310h0f1eb42_3 + - pyqtwebengine=5.15.7=py310h7fde93a_3 + - pyside2=5.15.8=py310hbfa27b9_2 + - python=3.10.10=h3ba56d0_0_cpython + - python_abi=3.10=3_cp310 + - qt-main=5.15.6=h160f5ef_4 + - qt-webengine=5.15.4=h3a00a3b_3 + - readline=8.2=h92ec313_1 + - setuptools=67.6.1=pyhd8ed1ab_0 + - sip=6.7.8=py310h0f1eb42_0 + - tk=8.6.12=he1e0b03_0 + - toml=0.10.2=pyhd8ed1ab_0 + - tomli=2.0.1=pyhd8ed1ab_0 + - tzdata=2023c=h71feb2d_0 + - wheel=0.40.0=pyhd8ed1ab_0 + - xz=5.2.6=h57fd34a_0 + - zstd=1.5.2=hf913c23_6 + - pip: + - h5py==3.8.0 + - joblib==1.2.0 + - lxml==4.9.2 + - markdown2==2.4.8 + - numpy==1.24.2 + - opencv-python-headless==4.7.0.72 + - pip-licenses==4.2.0 + - prettytable==3.7.0 + - ptable==0.9.2 + - pyyaml==6.0 + - scikit-learn==1.2.2 + - scipy==1.10.1 + - shapely==2.0.1 + - six==1.16.0 + - tabulate==0.9.0 + - threadpoolctl==3.1.0 + - unittest-xml-reporting==3.2.0 + - wcwidth==0.2.6 + - xgboost==1.7.5 From 5316f4dc4933035527f0f55a4733fa0c6e24a212 Mon Sep 17 00:00:00 2001 From: anshu957 <32687084+anshu957@users.noreply.github.com> Date: Sun, 23 Jul 2023 23:45:42 -0400 Subject: [PATCH 4/6] Update README.md Added installation instructions for apple M1/M2 macs. --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 4f33b70..0220c3e 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,17 @@ The virtual environment can be deactivated if you no longer need it: deactivate ``` +### Installing on Apple M1/M2 Silicone + +To install the app on Apple's newer M1/M2 macbooks, the user needs to install via [anaconda](https://www.anaconda.com/download#macos) +using the following instructions: + +```commandline +conda env create -n jabs -f environment_jabs.yml +conda activate jabs +python app.py +``` + #### Enabling XGBoost Classifier The XGBoost Classifier has a dependency on the OpenMP library. This does From 84bf8e428838220f42f77455a6ca75beaf89df0e Mon Sep 17 00:00:00 2001 From: Brian Geuther Date: Tue, 1 Aug 2023 14:45:44 -0400 Subject: [PATCH 5/6] Bugfixes from #27 that are needed for the conda env and luckily are compatible with venv --- src/feature_extraction/social_features/social_distance.py | 2 +- src/project/export_training.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/feature_extraction/social_features/social_distance.py b/src/feature_extraction/social_features/social_distance.py index e4773d9..a482d2e 100644 --- a/src/feature_extraction/social_features/social_distance.py +++ b/src/feature_extraction/social_features/social_distance.py @@ -59,7 +59,7 @@ def __init__(self, poses: PoseEstimation, identity: int, self_base_neck_point = points[idx.BASE_NECK, :] self_nose_point = points[idx.NOSE, :] - other_centroid = np.array(other_shape.centroid) + other_centroid = np.array(other_shape.centroid.coords[0]) view_angle = self.compute_angle( self_nose_point, diff --git a/src/project/export_training.py b/src/project/export_training.py index 55b8cd5..599784d 100644 --- a/src/project/export_training.py +++ b/src/project/export_training.py @@ -89,7 +89,7 @@ def export_training_data(project: 'Project', # store the video/identity to group mapping in the h5 file for group in group_mapping: dset = out_h5.create_dataset(f'group_mapping/{group}/identity', - (1,), dtype=np.int) + (1,), dtype=np.int64) dset[:] = group_mapping[group]['identity'] dset = out_h5.create_dataset(f'group_mapping/{group}/video_name', (1,), dtype=string_type) From 7a3f41e2ea0f9d9e1f313909ca7f4bd66c8d8e64 Mon Sep 17 00:00:00 2001 From: Brian Geuther Date: Tue, 1 Aug 2023 14:47:39 -0400 Subject: [PATCH 6/6] Bump version for release --- src/version/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version/__init__.py b/src/version/__init__.py index 9bb73cb..033999b 100644 --- a/src/version/__init__.py +++ b/src/version/__init__.py @@ -1,6 +1,6 @@ __MAJOR = 0 __MINOR = 16 -__PATCH = 2 +__PATCH = 3 def version_str():