CycleGAN CCTV Noise Generator
Description
CycleGAN model trained to transform clean images into CCTV-style noisy images.
Repository Structure
βββ checkpoints/
β βββ cyclegan_cctv/
β βββ G_cctv.pth # Generator model (Clean β Noisy)
βββ outputs/
β βββ cyclegan_cctv/ # Training outputs & visualizations
βββ coco_clean/ # Original COCO images (1000 samples)
βββ coco_noisy/ # CycleGAN-generated noisy images (1000 samples)
βββ README.md
Usage
Load Generator Model
from huggingface_hub import hf_hub_download
import torch
# Download model
model_path = hf_hub_download(
repo_id="dtann08/cyclegan-cctv-noise-generator",
filename="checkpoints/cyclegan_cctv/G_cctv.pth"
)
# Load model (define Generator class first)
G_AB = Generator(input_nc=3, output_nc=3, n_residual_blocks=6)
G_AB.load_state_dict(torch.load(model_path, map_location='cpu'))
G_AB.eval()
Download Dataset (Clean & Noisy pairs)
from huggingface_hub import snapshot_download
# Download specific folders
snapshot_download(
repo_id="dtann08/cyclegan-cctv-noise-generator",
allow_patterns=["coco_clean/*", "coco_noisy/*"],
local_dir="./data"
)
Training Details
- Architecture: ResNet-based CycleGAN
- Image Size: 128x128
- Epochs: 50
- Loss Functions: Adversarial + Cycle Consistency + Identity
License
MIT License