update
Browse files- .gitattributes +62 -35
- Dockerfile +6 -6
.gitattributes
CHANGED
|
@@ -1,35 +1,62 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
*
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
*.
|
| 10 |
-
*.
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
*.
|
| 14 |
-
*.
|
| 15 |
-
*.
|
| 16 |
-
*.
|
| 17 |
-
*.
|
| 18 |
-
*.
|
| 19 |
-
*.
|
| 20 |
-
*.
|
| 21 |
-
*.
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
*.
|
| 26 |
-
|
| 27 |
-
*.
|
| 28 |
-
*.
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
*.
|
| 32 |
-
*.
|
| 33 |
-
*.
|
| 34 |
-
*.
|
| 35 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ===========================
|
| 2 |
+
# .gitattributes for BackgroundFX Pro
|
| 3 |
+
# ===========================
|
| 4 |
+
|
| 5 |
+
# --- Default text handling (normalize line endings) ---
|
| 6 |
+
* text=auto eol=lf
|
| 7 |
+
|
| 8 |
+
# --- Python source (force LF) ---
|
| 9 |
+
*.py text eol=lf diff=python
|
| 10 |
+
*.pyw text eol=lf diff=python
|
| 11 |
+
|
| 12 |
+
# --- Configs / metadata ---
|
| 13 |
+
*.yml text eol=lf
|
| 14 |
+
*.yaml text eol=lf
|
| 15 |
+
*.toml text eol=lf
|
| 16 |
+
*.ini text eol=lf
|
| 17 |
+
*.json text eol=lf
|
| 18 |
+
*.md text eol=lf
|
| 19 |
+
*.txt text eol=lf
|
| 20 |
+
*.dockerignore text eol=lf
|
| 21 |
+
*.gitignore text eol=lf
|
| 22 |
+
Dockerfile text eol=lf
|
| 23 |
+
|
| 24 |
+
# --- Shell / scripts ---
|
| 25 |
+
*.sh text eol=lf
|
| 26 |
+
*.bash text eol=lf
|
| 27 |
+
*.bat text eol=crlf
|
| 28 |
+
*.cmd text eol=crlf
|
| 29 |
+
|
| 30 |
+
# --- Images (binary, no diff) ---
|
| 31 |
+
*.png binary
|
| 32 |
+
*.jpg binary
|
| 33 |
+
*.jpeg binary
|
| 34 |
+
*.gif binary
|
| 35 |
+
*.ico binary
|
| 36 |
+
|
| 37 |
+
# --- Videos (binary, no diff) ---
|
| 38 |
+
*.mp4 binary
|
| 39 |
+
*.avi binary
|
| 40 |
+
*.mov binary
|
| 41 |
+
*.mkv binary
|
| 42 |
+
*.webm binary
|
| 43 |
+
|
| 44 |
+
# --- Models / weights / checkpoints (binary, no diff) ---
|
| 45 |
+
*.pth binary
|
| 46 |
+
*.pt binary
|
| 47 |
+
*.ckpt binary
|
| 48 |
+
*.onnx binary
|
| 49 |
+
*.safetensors binary
|
| 50 |
+
|
| 51 |
+
# --- Misc binaries ---
|
| 52 |
+
*.pdf binary
|
| 53 |
+
*.zip binary
|
| 54 |
+
*.tar binary
|
| 55 |
+
*.gz binary
|
| 56 |
+
*.7z binary
|
| 57 |
+
|
| 58 |
+
# --- Large files (optional: hook into Git LFS if used) ---
|
| 59 |
+
# If you enable Git LFS, uncomment below for heavy assets:
|
| 60 |
+
# *.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
# *.pth filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
# *.ckpt filter=lfs diff=lfs merge=lfs -text
|
Dockerfile
CHANGED
|
@@ -17,6 +17,10 @@ ARG MATANY_FILENAME=matanyone_v1.0.pth
|
|
| 17 |
RUN useradd -m -u 1000 user
|
| 18 |
ENV HOME=/home/user
|
| 19 |
ENV PATH=/home/user/.local/bin:$PATH
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
WORKDIR /home/user/app
|
| 21 |
|
| 22 |
# --- System packages ---
|
|
@@ -27,8 +31,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
|
| 27 |
libgl1-mesa-glx libglib2.0-0 libsm6 libxext6 libxrender-dev libgomp1 \
|
| 28 |
&& rm -rf /var/lib/apt/lists/*
|
| 29 |
|
| 30 |
-
#
|
| 31 |
-
RUN mkdir -p /data/.cache && chown -R user:user /data
|
| 32 |
USER user
|
| 33 |
|
| 34 |
# --- Python + Torch (cu121) ---
|
|
@@ -43,9 +46,7 @@ RUN python3 -m pip install --no-cache-dir -r requirements.txt
|
|
| 43 |
RUN python3 -m pip install --no-cache-dir mediapipe==0.10.14
|
| 44 |
|
| 45 |
# --- Third-party repos (build-time, never at runtime) ---
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
# SAM2 (shallow clone; optional SHA pin)
|
| 49 |
RUN git clone --depth=1 https://github.com/facebookresearch/segment-anything-2.git third_party/sam2 && \
|
| 50 |
cd third_party/sam2 && \
|
| 51 |
if [ "${SAM2_SHA}" != "__PIN_ME__" ]; then git fetch --depth=1 origin ${SAM2_SHA} && git checkout ${SAM2_SHA}; fi
|
|
@@ -95,7 +96,6 @@ ENV PYTHONUNBUFFERED=1 \
|
|
| 95 |
ENABLE_MATANY=1
|
| 96 |
|
| 97 |
# Do NOT set PORT here; Spaces injects it.
|
| 98 |
-
|
| 99 |
EXPOSE 7860
|
| 100 |
|
| 101 |
# Optional: basic health check to see if the server bound
|
|
|
|
| 17 |
RUN useradd -m -u 1000 user
|
| 18 |
ENV HOME=/home/user
|
| 19 |
ENV PATH=/home/user/.local/bin:$PATH
|
| 20 |
+
|
| 21 |
+
# Pre-create app dir + caches with correct ownership (avoid permission denied)
|
| 22 |
+
RUN mkdir -p /home/user/app/third_party /data/.cache && \
|
| 23 |
+
chown -R user:user /home/user /data
|
| 24 |
WORKDIR /home/user/app
|
| 25 |
|
| 26 |
# --- System packages ---
|
|
|
|
| 31 |
libgl1-mesa-glx libglib2.0-0 libsm6 libxext6 libxrender-dev libgomp1 \
|
| 32 |
&& rm -rf /var/lib/apt/lists/*
|
| 33 |
|
| 34 |
+
# Switch to non-root for python/pip and repo work
|
|
|
|
| 35 |
USER user
|
| 36 |
|
| 37 |
# --- Python + Torch (cu121) ---
|
|
|
|
| 46 |
RUN python3 -m pip install --no-cache-dir mediapipe==0.10.14
|
| 47 |
|
| 48 |
# --- Third-party repos (build-time, never at runtime) ---
|
| 49 |
+
# (dir already exists and is owned by user)
|
|
|
|
|
|
|
| 50 |
RUN git clone --depth=1 https://github.com/facebookresearch/segment-anything-2.git third_party/sam2 && \
|
| 51 |
cd third_party/sam2 && \
|
| 52 |
if [ "${SAM2_SHA}" != "__PIN_ME__" ]; then git fetch --depth=1 origin ${SAM2_SHA} && git checkout ${SAM2_SHA}; fi
|
|
|
|
| 96 |
ENABLE_MATANY=1
|
| 97 |
|
| 98 |
# Do NOT set PORT here; Spaces injects it.
|
|
|
|
| 99 |
EXPOSE 7860
|
| 100 |
|
| 101 |
# Optional: basic health check to see if the server bound
|