k22056537 commited on
Commit
c2bffa9
·
1 Parent(s): 241eb23

fix: match integration_test2 Dockerfile and config

Browse files

Replicate the working setup from FocusGuard/integration_test2:
- Same Dockerfile structure with npm build and model downloads
- Same .dockerignore (excludes .git, dev files)
- Same .gitattributes (only pkl/npz/joblib as LFS)
- Un-LFS .pt files so they're real objects in Docker context

Files changed (5) hide show
  1. .dockerignore +26 -4
  2. .gitattributes +1 -6
  3. Dockerfile +8 -17
  4. checkpoints/mlp_best.pt +0 -0
  5. requirements.txt +5 -0
.dockerignore CHANGED
@@ -1,9 +1,31 @@
 
 
 
1
  node_modules
2
  dist
 
 
3
  __pycache__
4
  *.pyc
5
- .env
6
- .venv
7
- data/
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  *.db
9
- .eslintrc*
 
 
 
 
 
1
+ .git
2
+ .gitattributes
3
+ .github
4
  node_modules
5
  dist
6
+ venv
7
+ .venv
8
  __pycache__
9
  *.pyc
10
+ .pytest_cache
11
+ .mypy_cache
12
+ .ruff_cache
13
+
14
+ notebooks/
15
+ evaluation/
16
+ tests/
17
+ others/
18
+ *.ipynb
19
+ requirements-dev.txt
20
+ pytest.ini
21
+ eslint.config.js
22
+ docker-compose.yml
23
+
24
+ models/L2CS-Net/L2CS-Net-backup/
25
+
26
  *.db
27
+
28
+ .DS_Store
29
+ .cursor
30
+ .vscode
31
+ *.swp
.gitattributes CHANGED
@@ -1,8 +1,3 @@
1
- checkpoints/L2CSNet_gaze360.pkl filter=lfs diff=lfs merge=lfs -text
2
- models/L2CS-Net/models/L2CSNet_gaze360.pkl filter=lfs diff=lfs merge=lfs -text
3
  *.npz filter=lfs diff=lfs merge=lfs -text
4
- *.pt filter=lfs diff=lfs merge=lfs -text
5
- *.pth filter=lfs diff=lfs merge=lfs -text
6
  *.joblib filter=lfs diff=lfs merge=lfs -text
7
- *.db filter=lfs diff=lfs merge=lfs -text
8
- *.pkl filter=lfs diff=lfs merge=lfs -text
 
1
+ *.pkl filter=lfs diff=lfs merge=lfs -text
 
2
  *.npz filter=lfs diff=lfs merge=lfs -text
 
 
3
  *.joblib filter=lfs diff=lfs merge=lfs -text
 
 
Dockerfile CHANGED
@@ -2,7 +2,6 @@ FROM python:3.10-slim
2
 
3
  RUN useradd -m -u 1000 user
4
  ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
5
-
6
  ENV PYTHONUNBUFFERED=1
7
 
8
  WORKDIR /app
@@ -11,33 +10,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
11
  libglib2.0-0 libsm6 libxrender1 libxext6 libxcb1 libgl1 libgomp1 \
12
  ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev \
13
  libavdevice-dev libopus-dev libvpx-dev libsrtp2-dev \
14
- build-essential git git-lfs curl \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
  RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
18
 
19
  COPY requirements.txt ./
20
- RUN pip install --no-cache-dir -r requirements.txt
 
21
 
22
  COPY . .
23
 
24
- # Resolve LFS pointers to real binary files, then drop .git
25
- RUN git lfs install && \
26
- git lfs pull && \
27
- rm -rf .git
28
 
29
- # Download face_mesh model (non-fatal if network blocked)
30
  ENV FOCUSGUARD_CACHE_DIR=/app/.cache/focusguard
31
- RUN python -c "\
32
- try:\
33
- from models.face_mesh import _ensure_model; _ensure_model(); print('face_mesh model cached')\
34
- except Exception as e:\
35
- print(f'face_mesh pre-download skipped: {e}')\
36
- "
37
-
38
- RUN python download_l2cs_weights.py || echo "[WARN] L2CS weights skipped"
39
 
40
- RUN mkdir -p /app/data /app/.cache && chown -R user:user /app
41
 
42
  USER user
43
  EXPOSE 7860
 
2
 
3
  RUN useradd -m -u 1000 user
4
  ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
 
5
  ENV PYTHONUNBUFFERED=1
6
 
7
  WORKDIR /app
 
10
  libglib2.0-0 libsm6 libxrender1 libxext6 libxcb1 libgl1 libgomp1 \
11
  ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev \
12
  libavdevice-dev libopus-dev libvpx-dev libsrtp2-dev \
13
+ build-essential nodejs npm git \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
  RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
17
 
18
  COPY requirements.txt ./
19
+ RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu \
20
+ && pip install --no-cache-dir -r requirements.txt
21
 
22
  COPY . .
23
 
24
+ RUN npm install && npm run build && mkdir -p /app/static && cp -R dist/* /app/static/ \
25
+ && rm -rf node_modules dist
 
 
26
 
 
27
  ENV FOCUSGUARD_CACHE_DIR=/app/.cache/focusguard
28
+ RUN python -c "from models.face_mesh import _ensure_model; _ensure_model()"
29
+ RUN python download_l2cs_weights.py || echo "[WARN] L2CS weights not downloaded — will run without gaze model"
 
 
 
 
 
 
30
 
31
+ RUN mkdir -p /app/data && chown -R user:user /app
32
 
33
  USER user
34
  EXPOSE 7860
checkpoints/mlp_best.pt CHANGED
Binary files a/checkpoints/mlp_best.pt and b/checkpoints/mlp_best.pt differ
 
requirements.txt CHANGED
@@ -8,6 +8,8 @@ opencv-contrib-python>=4.8.0
8
  numpy>=1.24.0
9
  scikit-learn>=1.2.0
10
  joblib>=1.2.0
 
 
11
  fastapi>=0.104.0
12
  uvicorn[standard]>=0.24.0
13
  httpx>=0.27.0
@@ -15,5 +17,8 @@ aiosqlite>=0.19.0
15
  psutil>=5.9.0
16
  pydantic>=2.0.0
17
  xgboost>=2.0.0
 
 
 
18
  face_detection @ git+https://github.com/elliottzheng/face-detection
19
  gdown>=5.0.0
 
8
  numpy>=1.24.0
9
  scikit-learn>=1.2.0
10
  joblib>=1.2.0
11
+ torch>=2.0.0
12
+ torchvision>=0.15.0
13
  fastapi>=0.104.0
14
  uvicorn[standard]>=0.24.0
15
  httpx>=0.27.0
 
17
  psutil>=5.9.0
18
  pydantic>=2.0.0
19
  xgboost>=2.0.0
20
+ clearml>=2.0.2
21
+ pytest>=9.0.0
22
+ pytest-cov>=5.0.0
23
  face_detection @ git+https://github.com/elliottzheng/face-detection
24
  gdown>=5.0.0