Cuong2004 commited on
Commit
6695bc6
·
1 Parent(s): f21948d

Fix dependencies and model download URLs - Update to compatible versions

Browse files
Files changed (5) hide show
  1. Dockerfile +15 -4
  2. app.py +1 -1
  3. download_models.py +4 -4
  4. requirements-flexible.txt +34 -0
  5. requirements.txt +17 -17
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM python:3.9-slim
2
 
3
  # Set working directory
4
  WORKDIR /app
@@ -12,14 +12,25 @@ RUN apt-get update && apt-get install -y \
12
  libxrender-dev \
13
  libgomp1 \
14
  libglib2.0-0 \
 
 
 
 
 
15
  curl \
 
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
  # Copy requirements first to leverage Docker cache
19
- COPY requirements.txt .
20
 
21
- # Install Python dependencies
22
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
23
 
24
  # Copy application code
25
  COPY . .
 
1
+ FROM python:3.11-slim
2
 
3
  # Set working directory
4
  WORKDIR /app
 
12
  libxrender-dev \
13
  libgomp1 \
14
  libglib2.0-0 \
15
+ libgthread-2.0-0 \
16
+ libgtk-3-0 \
17
+ libavcodec-dev \
18
+ libavformat-dev \
19
+ libswscale-dev \
20
  curl \
21
+ wget \
22
  && rm -rf /var/lib/apt/lists/*
23
 
24
  # Copy requirements first to leverage Docker cache
25
+ COPY requirements.txt requirements-flexible.txt ./
26
 
27
+ # Upgrade pip first
28
+ RUN pip install --upgrade pip
29
+
30
+ # Install Python dependencies with fallback to flexible versions
31
+ RUN pip install --no-cache-dir -r requirements.txt || \
32
+ (echo "Fixed versions failed, trying flexible versions..." && \
33
+ pip install --no-cache-dir -r requirements-flexible.txt)
34
 
35
  # Copy application code
36
  COPY . .
app.py CHANGED
@@ -156,7 +156,7 @@ if __name__ == '__main__':
156
  # Start the Flask app
157
  logger.info("🌐 Starting Flask server in PRODUCTION mode...")
158
  logger.info("📱 App will be available at: http://localhost:5000")
159
- logger.info("📱 Network access at: http://0.0.0.0:5000")
160
  logger.info("🔧 For development mode, use: python run_dev.py")
161
  logger.info("🛑 Press Ctrl+C to stop")
162
  logger.info("=" * 50)
 
156
  # Start the Flask app
157
  logger.info("🌐 Starting Flask server in PRODUCTION mode...")
158
  logger.info("📱 App will be available at: http://localhost:5000")
159
+ logger.info("📱 Network access at: http://0.0.0.0:5000")
160
  logger.info("🔧 For development mode, use: python run_dev.py")
161
  logger.info("🛑 Press Ctrl+C to stop")
162
  logger.info("=" * 50)
download_models.py CHANGED
@@ -16,19 +16,19 @@ logger = logging.getLogger(__name__)
16
  # Model files and their download URLs
17
  MODEL_FILES = {
18
  'best_stgcn.weights.h5': {
19
- 'url': 'https://huggingface.co/your-username/gym-classification-models/resolve/main/best_stgcn.weights.h5',
20
  'size_mb': 50
21
  },
22
  'Transformer_12rel_4_bs16_sl32.keras': {
23
- 'url': 'https://huggingface.co/your-username/gym-classification-models/resolve/main/Transformer_12rel_4_bs16_sl32.keras',
24
  'size_mb': 25
25
  },
26
  'Transformer_12rel_4_angle3_branch_bs16_sl32.keras': {
27
- 'url': 'https://huggingface.co/your-username/gym-classification-models/resolve/main/Transformer_12rel_4_angle3_branch_bs16_sl32.keras',
28
  'size_mb': 30
29
  },
30
  'best_swin3d_b_22k.pth': {
31
- 'url': 'https://huggingface.co/your-username/gym-classification-models/resolve/main/best_swin3d_b_22k.pth',
32
  'size_mb': 200
33
  }
34
  }
 
16
  # Model files and their download URLs
17
  MODEL_FILES = {
18
  'best_stgcn.weights.h5': {
19
+ 'url': 'https://huggingface.co/Cuong2004/gym-classification-models/resolve/main/best_stgcn.weights.h5',
20
  'size_mb': 50
21
  },
22
  'Transformer_12rel_4_bs16_sl32.keras': {
23
+ 'url': 'https://huggingface.co/Cuong2004/gym-classification-models/resolve/main/Transformer_12rel_4_bs16_sl32.keras',
24
  'size_mb': 25
25
  },
26
  'Transformer_12rel_4_angle3_branch_bs16_sl32.keras': {
27
+ 'url': 'https://huggingface.co/Cuong2004/gym-classification-models/resolve/main/Transformer_12rel_4_angle3_branch_bs16_sl32.keras',
28
  'size_mb': 30
29
  },
30
  'best_swin3d_b_22k.pth': {
31
+ 'url': 'https://huggingface.co/Cuong2004/gym-classification-models/resolve/main/best_swin3d_b_22k.pth',
32
  'size_mb': 200
33
  }
34
  }
requirements-flexible.txt ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Flask>=3.0.0
2
+ Werkzeug>=3.0.0
3
+ gunicorn>=21.0.0
4
+
5
+ # Machine Learning
6
+ tensorflow>=2.14.0,<3.0.0
7
+ torch>=2.0.0,<3.0.0
8
+ torchvision>=0.15.0,<1.0.0
9
+ scikit-learn>=1.3.0
10
+
11
+ # Computer Vision & Video Processing
12
+ mediapipe>=0.10.20
13
+ opencv-python-headless>=4.9.0
14
+ av>=10.0.0
15
+ Pillow>=10.0.0
16
+
17
+ # Data Processing
18
+ numpy>=1.24.0,<2.0.0
19
+ pandas>=2.0.0
20
+
21
+ # YouTube Downloads
22
+ yt-dlp>=2024.1.0
23
+
24
+ # Utilities
25
+ tqdm>=4.65.0
26
+ matplotlib>=3.7.0
27
+ scipy>=1.11.0
28
+
29
+ # System monitoring
30
+ psutil>=5.9.0
31
+
32
+ # For Hugging Face deployment
33
+ requests>=2.31.0
34
+ typing_extensions>=4.8.0
requirements.txt CHANGED
@@ -1,34 +1,34 @@
1
- Flask==2.3.3
2
- Werkzeug==2.3.7
3
  gunicorn==21.2.0
4
 
5
  # Machine Learning
6
- tensorflow==2.13.0
7
- torch==2.0.1
8
- torchvision==0.15.2
9
- scikit-learn==1.3.0
10
 
11
  # Computer Vision & Video Processing
12
- mediapipe==0.10.3
13
- opencv-python-headless==4.8.1.78
14
- av==10.0.0
15
- Pillow==10.0.1
16
 
17
  # Data Processing
18
- numpy==1.24.3
19
- pandas==2.0.3
20
 
21
  # YouTube Downloads
22
- yt-dlp==2023.9.24
23
 
24
  # Utilities
25
  tqdm==4.66.1
26
- matplotlib==3.7.2
27
- scipy==1.11.3
28
 
29
  # System monitoring
30
- psutil==5.9.5
31
 
32
  # For Hugging Face deployment
33
  requests==2.31.0
34
- typing_extensions>=4.8.0
 
1
+ Flask==3.0.0
2
+ Werkzeug==3.0.1
3
  gunicorn==21.2.0
4
 
5
  # Machine Learning
6
+ tensorflow==2.15.0
7
+ torch==2.1.0
8
+ torchvision==0.16.0
9
+ scikit-learn==1.4.0
10
 
11
  # Computer Vision & Video Processing
12
+ mediapipe==0.10.21
13
+ opencv-python-headless==4.9.0.80
14
+ av==11.0.0
15
+ Pillow==10.2.0
16
 
17
  # Data Processing
18
+ numpy==1.26.0
19
+ pandas==2.1.0
20
 
21
  # YouTube Downloads
22
+ yt-dlp==2024.1.6
23
 
24
  # Utilities
25
  tqdm==4.66.1
26
+ matplotlib==3.8.0
27
+ scipy==1.12.0
28
 
29
  # System monitoring
30
+ psutil==5.9.6
31
 
32
  # For Hugging Face deployment
33
  requests==2.31.0
34
+ typing_extensions>=4.9.0