help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • Blog
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
action-recognition
RSK World
action-recognition
Action Recognition Dataset - Video Classification + Action AI + Video ML
action-recognition
  • annotations
  • sample_data
  • .gitignore1.2 KB
  • LICENSE.txt3.3 KB
  • README.md13.1 KB
  • RELEASE_NOTES.md4 KB
  • action-recognition.png150.5 KB
  • api_server.py16.1 KB
  • augmentation.py15.9 KB
  • benchmark.py20.6 KB
  • config.json2.8 KB
  • convert_videos.py3.5 KB
  • create_logo.py5.5 KB
  • demo.html28.3 KB
  • download_real_human_videos.py12.6 KB
  • download_real_videos.py21.1 KB
  • download_ucf101.py19.6 KB
  • download_youtube_videos.py10.1 KB
  • favicon.png786 B
  • generate_browser_videos.py10.7 KB
  • generate_samples.py19.4 KB
  • get_real_videos.py8.2 KB
  • index.html38.8 KB
  • loader.py8.9 KB
  • logo.png8.5 KB
  • process_downloaded.py4.6 KB
  • real_running_preview.png195.6 KB
  • real_video_preview.png330.6 KB
  • realtime_predictor.py14.3 KB
  • requirements.txt1.9 KB
  • script.js13.8 KB
  • styles.css39.4 KB
  • train_model.py20.5 KB
  • video_preview.png61.3 KB
  • visualize_dataset.py18 KB
stock_info.jsondownload_real_human_videos.py
download_real_human_videos.py
Raw Download
Find: Go to:
"""
==================================================================================
    Action Recognition Dataset - REAL Human Video Downloader
==================================================================================
    Project: Action Recognition Dataset
    
    Downloads REAL human action videos from FREE sources (Pexels, Pixabay)
    
==================================================================================
    DEVELOPER INFORMATION
==================================================================================
    Website: RSK World (https://rskworld.in)
    Founded by: Molla Samser
    Designer & Tester: Rima Khatun
    Contact: help@rskworld.in | +91 93305 39277
    
    (c) 2026 RSK World. All Rights Reserved.
==================================================================================
"""

import os
import sys
import urllib.request
import ssl
from pathlib import Path
import json
import time

# Install dependencies
try:
    import cv2
    import numpy as np
except ImportError:
    import subprocess
    subprocess.check_call([sys.executable, "-m", "pip", "install", "opencv-python", "numpy"])
    import cv2
    import numpy as np

# Disable SSL verification for downloads
ssl._create_default_https_context = ssl._create_unverified_context

# ==================================================================================
# Configuration
# ==================================================================================

OUTPUT_DIR = Path("sample_data")
TARGET_SIZE = (640, 480)
MAX_DURATION = 5
FPS = 30

# RSK World Colors (BGR)
LOGO_COLOR = (255, 212, 0)
TEXT_COLOR = (255, 255, 255)

# Real human video URLs from Pexels (FREE to use)
# These are direct video links from Pexels free stock videos
REAL_VIDEOS = {
    "walking": [
        {
            "url": "https://videos.pexels.com/video-files/5319934/5319934-sd_640_360_25fps.mp4",
            "name": "walking_001"
        },
        {
            "url": "https://videos.pexels.com/video-files/6387101/6387101-sd_640_360_25fps.mp4",
            "name": "walking_002"
        },
        {
            "url": "https://videos.pexels.com/video-files/4536724/4536724-sd_640_360_25fps.mp4",
            "name": "walking_003"
        }
    ],
    "running": [
        {
            "url": "https://videos.pexels.com/video-files/5319940/5319940-sd_640_360_25fps.mp4",
            "name": "running_001"
        },
        {
            "url": "https://videos.pexels.com/video-files/4761437/4761437-sd_640_360_25fps.mp4",
            "name": "running_002"
        },
        {
            "url": "https://videos.pexels.com/video-files/4763826/4763826-sd_640_360_24fps.mp4",
            "name": "running_003"
        }
    ],
    "jumping": [
        {
            "url": "https://videos.pexels.com/video-files/4761554/4761554-sd_640_360_25fps.mp4",
            "name": "jumping_001"
        },
        {
            "url": "https://videos.pexels.com/video-files/5752729/5752729-sd_640_360_25fps.mp4",
            "name": "jumping_002"
        }
    ],
    "dancing": [
        {
            "url": "https://videos.pexels.com/video-files/6394054/6394054-sd_640_360_30fps.mp4",
            "name": "dancing_001"
        },
        {
            "url": "https://videos.pexels.com/video-files/5973073/5973073-sd_640_360_25fps.mp4",
            "name": "dancing_002"
        },
        {
            "url": "https://videos.pexels.com/video-files/6252820/6252820-sd_640_360_30fps.mp4",
            "name": "dancing_003"
        }
    ],
    "exercising": [
        {
            "url": "https://videos.pexels.com/video-files/4761671/4761671-sd_640_360_25fps.mp4",
            "name": "exercising_001"
        },
        {
            "url": "https://videos.pexels.com/video-files/4761709/4761709-sd_640_360_25fps.mp4",
            "name": "exercising_002"
        },
        {
            "url": "https://videos.pexels.com/video-files/4761815/4761815-sd_640_360_25fps.mp4",
            "name": "exercising_003"
        }
    ],
    "yoga": [
        {
            "url": "https://videos.pexels.com/video-files/4057411/4057411-sd_640_360_24fps.mp4",
            "name": "yoga_001"
        },
        {
            "url": "https://videos.pexels.com/video-files/4056990/4056990-sd_640_360_24fps.mp4",
            "name": "yoga_002"
        }
    ],
    "stretching": [
        {
            "url": "https://videos.pexels.com/video-files/4057049/4057049-sd_640_360_24fps.mp4",
            "name": "stretching_001"
        },
        {
            "url": "https://videos.pexels.com/video-files/4057054/4057054-sd_640_360_24fps.mp4",
            "name": "stretching_002"
        }
    ],
    "boxing": [
        {
            "url": "https://videos.pexels.com/video-files/4761937/4761937-sd_640_360_25fps.mp4",
            "name": "boxing_001"
        },
        {
            "url": "https://videos.pexels.com/video-files/4754021/4754021-sd_640_360_25fps.mp4",
            "name": "boxing_002"
        }
    ]
}


# ==================================================================================
# RSK World Branding
# ==================================================================================

def add_watermark(frame, action_name):
    """Add RSK World watermark to frame"""
    h, w = frame.shape[:2]
    overlay = frame.copy()
    
    # Bottom bar
    cv2.rectangle(overlay, (0, h - 50), (w, h), (0, 0, 0), -1)
    # Top right logo area
    cv2.rectangle(overlay, (w - 190, 5), (w - 5, 40), (0, 0, 0), -1)
    
    cv2.addWeighted(overlay, 0.6, frame, 0.4, 0, frame)
    
    font = cv2.FONT_HERSHEY_SIMPLEX
    
    # Logo
    cv2.putText(frame, "RSK", (w - 180, 30), font, 0.7, TEXT_COLOR, 2, cv2.LINE_AA)
    cv2.putText(frame, "World", (w - 130, 30), font, 0.7, LOGO_COLOR, 2, cv2.LINE_AA)
    cv2.putText(frame, ".in", (w - 60, 30), font, 0.5, (150, 150, 150), 1, cv2.LINE_AA)
    
    # Action label
    label = action_name.upper()
    size = cv2.getTextSize(label, font, 1.0, 2)[0]
    cv2.putText(frame, label, ((w - size[0]) // 2, h - 15), font, 1.0, LOGO_COLOR, 2, cv2.LINE_AA)
    
    # Copyright
    cv2.putText(frame, "rskworld.in", (10, h - 15), font, 0.4, (150, 150, 150), 1, cv2.LINE_AA)
    
    return frame


def process_video(input_path, output_path, action_name):
    """Process video with branding"""
    cap = cv2.VideoCapture(str(input_path))
    if not cap.isOpened():
        return False
    
    fps = int(cap.get(cv2.CAP_PROP_FPS)) or FPS
    total = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
    max_frames = min(total, fps * MAX_DURATION)
    
    fourcc = cv2.VideoWriter_fourcc(*'mp4v')
    out = cv2.VideoWriter(str(output_path), fourcc, fps, TARGET_SIZE)
    
    count = 0
    while count < max_frames:
        ret, frame = cap.read()
        if not ret:
            break
        frame = cv2.resize(frame, TARGET_SIZE)
        frame = add_watermark(frame, action_name)
        out.write(frame)
        count += 1
    
    cap.release()
    out.release()
    return count > 0


# ==================================================================================
# Download Functions
# ==================================================================================

def download_video(url, output_path):
    """Download video from URL"""
    try:
        headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
        }
        request = urllib.request.Request(url, headers=headers)
        
        print(f"      Downloading from: {url[:50]}...")
        
        with urllib.request.urlopen(request, timeout=60) as response:
            with open(output_path, 'wb') as f:
                f.write(response.read())
        
        return True
    except Exception as e:
        print(f"      [ERROR] {e}")
        return False


def download_from_pexels_api(action, output_dir):
    """Download videos using Pexels search"""
    # Alternative method using web scraping
    search_url = f"https://www.pexels.com/search/videos/{action}/"
    print(f"    Searching Pexels for '{action}' videos...")
    return False


# ==================================================================================
# Main Functions
# ==================================================================================

def create_directories():
    """Create output directories"""
    actions = list(REAL_VIDEOS.keys())
    for split in ["train", "val", "test"]:
        for action in actions:
            (OUTPUT_DIR / split / action).mkdir(parents=True, exist_ok=True)
    print("[OK] Directories created")


def download_all_videos():
    """
    Download all real human videos
    
    RSK World (https://rskworld.in)
    Founder: Molla Samser
    """
    print("=" * 60)
    print("Action Recognition - REAL Human Video Downloader")
    print("=" * 60)
    print("Website: https://rskworld.in")
    print("Founder: Molla Samser")
    print("Designer: Rima Khatun")
    print("Contact: help@rskworld.in | +91 93305 39277")
    print("=" * 60)
    print()
    print("Downloading REAL human action videos from Pexels...")
    print("(Free stock videos - no copyright issues)")
    print()
    
    create_directories()
    print()
    
    total_downloaded = 0
    total_failed = 0
    
    for action, videos in REAL_VIDEOS.items():
        print(f"\n[{action.upper()}]")
        
        for i, video_info in enumerate(videos):
            url = video_info["url"]
            name = video_info["name"]
            
            # Determine split
            if i < len(videos) - 2:
                split = "train"
            elif i == len(videos) - 2:
                split = "val"
            else:
                split = "test"
            
            # Ensure at least one in train
            if len(videos) <= 2:
                split = "train" if i == 0 else ("val" if i == 1 else "test")
            if len(videos) == 1:
                split = "train"
            
            temp_path = OUTPUT_DIR / "temp_download.mp4"
            output_path = OUTPUT_DIR / split / action / f"{name}.mp4"
            
            print(f"  [{split}] {name}")
            
            if download_video(url, temp_path):
                if process_video(temp_path, output_path, action):
                    print(f"      [OK] Saved: {output_path}")
                    total_downloaded += 1
                else:
                    print(f"      [ERROR] Processing failed")
                    total_failed += 1
                
                # Remove temp file
                if temp_path.exists():
                    temp_path.unlink()
            else:
                total_failed += 1
            
            # Small delay to be polite to servers
            time.sleep(0.5)
    
    # Create dataset info
    info = {
        "_info": {
            "project": "Action Recognition Dataset",
            "website": "https://rskworld.in",
            "founder": "Molla Samser",
            "designer": "Rima Khatun",
            "contact": "help@rskworld.in",
            "copyright": "(c) 2026 RSK World"
        },
        "source": "Pexels Free Stock Videos",
        "license": "Free to use (Pexels License)",
        "statistics": {
            "downloaded": total_downloaded,
            "failed": total_failed,
            "classes": list(REAL_VIDEOS.keys())
        }
    }
    
    with open(OUTPUT_DIR / "dataset_info.json", "w") as f:
        json.dump(info, f, indent=4)
    
    print()
    print("=" * 60)
    print(f"Download Complete!")
    print(f"  Downloaded: {total_downloaded} videos")
    print(f"  Failed: {total_failed} videos")
    print("=" * 60)
    print()
    print("All videos include RSK World branding!")
    print("Visit: https://rskworld.in")
    
    return total_downloaded


# ==================================================================================
# Entry Point
# ==================================================================================

if __name__ == "__main__":
    try:
        downloaded = download_all_videos()
        
        if downloaded == 0:
            print()
            print("No videos downloaded. This might be due to network issues.")
            print("Try running the script again or check your internet connection.")
            
    except KeyboardInterrupt:
        print("\n\nCancelled by user.")
    except Exception as e:
        print(f"\nError: {e}")
        print("\nContact: help@rskworld.in for support")
386 lines•12.6 KB
python

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer