Skip to content

Codes for sky image/video data preprocessing/compression and implementations of video foundation models for PV regression

Notifications You must be signed in to change notification settings

ph3rro/PVOutputPrediction

Repository files navigation

PV Output Forecasting from Sky Images with VideoMAEv2

Data preprocessing scripts for sky-video-PV pairs and modified VideoMAEv2 for regression and PV output forecasting from 15-minute sky videos, with a forecast horizon of 15 minutes.

Installation

Prerequisites

  • Python 3.13
  • NVIDIA GPU with CUDA support (recommended for training)
  • CUDA 12.6+ (version compatible with Pytorch)
  • Git

Step 1: Clone the Repository

git clone https://github.com/ph3rro/PVOutputPrediction
cd PVOutputPrediction

Step 2: Create Virtual Environments

Install Python 3.13 and add to PATH.

You will need two separate virtual environments—one for the preprocessing notebooks and one for VideoMAEv2

python3.13 -m venv preprocessing-env
cd models/VideoMAEv2
python3.13 -m venv VideoMAE-env

Step 3: Install PyTorch with CUDA Support

Install PyTorch first (on both environments), as it requires specific CUDA versions. Visit PyTorch Get Started to get the appropriate command for your system.

For CUDA 13.0 (as used in this project):

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130

Step 4: Install Core Dependencies

Install the main project dependencies in two separate virtual environments for preprocessing notebooks and VideoMAE:

Windows

preprocessing-env\Scripts\activate
pip install -r requirements.txt
deactivate
cd models/VideoMAEv2
VideoMAE-env\Scripts\activate
pip install -r requirements-MAE.txt

Linux

source preprocessing-env/bin/activate
pip install -r requirements.txt
deactivate
cd models/VideoMAEv2
source VideoMAE-env/bin/activate
pip install -r requirements-MAE.txt

This will install:

  • Core libraries: numpy, pandas, scipy
  • Deep learning: scikit-learn, timm, transformers
  • Computer vision: opencv-python, pillow
  • Data handling: h5py, hdf5plugin
  • Utilities: CRPS, tqdm, tensorboard, matplotlib
  • Jupyter notebook support

Step 5: Verify Installation

Check that PyTorch can access your GPU:

import torch
print(f"PyTorch version: {torch.__version__}")
print(f"CUDA available: {torch.cuda.is_available()}")
print(f"CUDA version: {torch.version.cuda}")
if torch.cuda.is_available():
    print(f"GPU: {torch.cuda.get_device_name(0)}")

VideoMAEv2 Training

Finetuning

CUDA

python run_class_finetuning.py --batch_size=3 --lr=1e-3 --num_workers=0 --mixup=0 --cutmix=0

CPU (not recommended)

python run_class_finetuning.py --batch_size=3 --lr=1e-3 --num_workers=0 --mixup=0 --cutmix=0 --device='cpu'

Pretraining

Windows

python run_class_pretraining.py

Linux

About

Codes for sky image/video data preprocessing/compression and implementations of video foundation models for PV regression

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published