YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

PredNet denoising (black-box SavedModel)

This repository packages a TensorFlow SavedModel for video-frame prediction/denoising without publishing any model architecture source code. Inference calls the SavedModel signature as a black box and produces predicted frames.

Files

  • savedmodel/: TensorFlow SavedModel directory (weights + graph)
  • infer/: minimal inference helpers (black-box loader + IO)
  • predict.py: CLI that outputs prediction images
  • anomaly.py: CLI that outputs per-frame anomaly scores (ahat_error + 1-SSIM vectors)

Install

pip install -r requirements.txt

Run (from a directory of frames)

frames_dir should contain ordered image frames (e.g. 0001.png, 0002.png, ...).

python predict.py --model_dir savedmodel --frames_dir /path/to/frames --out_dir outputs --save_sequence_grid

Outputs:

  • outputs/pred_last.png
  • outputs/pred_sequence_grid.png (optional)

Run (from npy/npz)

Accepts frames stored as [T,H,W,C] or [B,T,H,W,C].

python predict.py --array frames.npy --out_dir outputs

Anomaly scores (4-frame window)

For each window of 4 frames ending at time t, this computes two vectors of length 4:

  • ahat_error[1..4]: mean absolute error between pred_frame_k and GT_frame_4
  • dissim_1mssim[1..4]: 1 - SSIM(pred_frame_k, GT_frame_4)
python anomaly.py --model_dir savedmodel --frames_dir /path/to/frames --out_json anomaly.json --out_csv anomaly.csv

Hugging Face Hub usage

After you upload this repo to the Hub, users can download it via huggingface_hub and point --model_dir at the downloaded savedmodel/ directory.

HuggingFace Pipeline Usage

from transformers import pipeline
import numpy as np

pipe = pipeline(
    "video-frame-prediction",
    model="dvdface/denoising-prednet",
    trust_remote_code=True,
)

# frames: [T, H, W, C] numpy array, uint8 (0-255) or float (0-1)
frames = np.random.randint(0, 255, (4, 128, 128, 3), dtype=np.uint8)
result = pipe(frames)

print(result["sequence"].shape)    # (4, 128, 128, 3)
print(result["last_frame"].shape)  # (128, 128, 3)
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support