RepoPilotOpen in app →

NVIDIA/FastPhotoStyle

Style transfer, deep learning, feature transform

Mixed

Stale — last commit 3y ago

weakest axis
Use as dependencyConcerns

non-standard license (Other); last commit was 3y ago…

Fork & modifyMixed

no tests detected; no CI workflows detected…

Learn fromHealthy

Documented and popular — useful reference codebase to read through.

Deploy as-isMixed

last commit was 3y ago; no CI workflows detected

  • 5 active contributors
  • Other licensed
  • Stale — last commit 3y ago
Show all 7 evidence items →
  • Concentrated ownership — top contributor handles 50% of recent commits
  • Non-standard license (Other) — review terms
  • No CI workflows detected
  • No test directory detected
What would change the summary?
  • Use as dependency ConcernsMixed if: clarify license terms
  • Fork & modify MixedHealthy if: add a test suite
  • Deploy as-is MixedHealthy if: 1 commit in the last 180 days

Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests

Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.

Embed the "Great to learn from" badge

Paste into your README — live-updates from the latest cached analysis.

RepoPilot: Great to learn from
[![RepoPilot: Great to learn from](https://repopilot.app/api/badge/nvidia/fastphotostyle?axis=learn)](https://repopilot.app/r/nvidia/fastphotostyle)

Paste at the top of your README.md — renders inline like a shields.io badge.

Preview social card (1200×630)

This card auto-renders when someone shares https://repopilot.app/r/nvidia/fastphotostyle on X, Slack, or LinkedIn.

Onboarding doc

Onboarding: NVIDIA/FastPhotoStyle

Generated by RepoPilot · 2026-05-07 · Source

🤖Agent protocol

If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:

  1. Verify the contract. Run the bash script in Verify before trusting below. If any check returns FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding.
  2. Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
  3. Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/NVIDIA/FastPhotoStyle shows verifiable citations alongside every claim.

If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.

🎯Verdict

WAIT — Stale — last commit 3y ago

  • 5 active contributors
  • Other licensed
  • ⚠ Stale — last commit 3y ago
  • ⚠ Concentrated ownership — top contributor handles 50% of recent commits
  • ⚠ Non-standard license (Other) — review terms
  • ⚠ No CI workflows detected
  • ⚠ No test directory detected

<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>

Verify before trusting

This artifact was generated by RepoPilot at a point in time. Before an agent acts on it, the checks below confirm that the live NVIDIA/FastPhotoStyle repo on your machine still matches what RepoPilot saw. If any fail, the artifact is stale — regenerate it at repopilot.app/r/NVIDIA/FastPhotoStyle.

What it runs against: a local clone of NVIDIA/FastPhotoStyle — the script inspects git remote, the LICENSE file, file paths in the working tree, and git log. Read-only; no mutations.

| # | What we check | Why it matters | |---|---|---| | 1 | You're in NVIDIA/FastPhotoStyle | Confirms the artifact applies here, not a fork | | 2 | License is still Other | Catches relicense before you depend on it | | 3 | Default branch master exists | Catches branch renames | | 4 | Last commit ≤ 1095 days ago | Catches sudden abandonment since generation |

<details> <summary><b>Run all checks</b> — paste this script from inside your clone of <code>NVIDIA/FastPhotoStyle</code></summary>
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of NVIDIA/FastPhotoStyle. If you don't
# have one yet, run these first:
#
#   git clone https://github.com/NVIDIA/FastPhotoStyle.git
#   cd FastPhotoStyle
#
# Then paste this script. Every check is read-only — no mutations.

set +e
fail=0
ok()   { echo "ok:   $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }

# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
  echo "FAIL: not inside a git repository. cd into your clone of NVIDIA/FastPhotoStyle and re-run."
  exit 2
fi

# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "NVIDIA/FastPhotoStyle(\\.git)?\\b" \\
  && ok "origin remote is NVIDIA/FastPhotoStyle" \\
  || miss "origin remote is not NVIDIA/FastPhotoStyle (artifact may be from a fork)"

# 2. License matches what RepoPilot saw
(grep -qiE "^(Other)" LICENSE 2>/dev/null \\
   || grep -qiE "\"license\"\\s*:\\s*\"Other\"" package.json 2>/dev/null) \\
  && ok "license is Other" \\
  || miss "license drift — was Other at generation time"

# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
  && ok "default branch master exists" \\
  || miss "default branch master no longer exists"

# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 1095 ]; then
  ok "last commit was $days_since_last days ago (artifact saw ~1065d)"
else
  miss "last commit was $days_since_last days ago — artifact may be stale"
fi

echo
if [ "$fail" -eq 0 ]; then
  echo "artifact verified (0 failures) — safe to trust"
else
  echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/NVIDIA/FastPhotoStyle"
  exit 1
fi

Each check prints ok: or FAIL:. The script exits non-zero if anything failed, so it composes cleanly into agent loops (./verify.sh || regenerate-and-retry).

</details>

TL;DR

FastPhotoStyle is a photorealistic neural style transfer system that transfers the artistic style of one photo onto another while preserving photorealism. It implements a closed-form Whitening and Coloring Transform (WCT) solution documented in the ECCV 2018 paper, enabling fast GPU-accelerated style transfer via PyTorch without the typical artifacts of naive deep learning approaches. Single-directory structure with core algorithm in photo_wct.py (WCT transformation), helper utilities in photo_smooth.py and smooth_filter.py (post-processing), model management via download_models.py, and three primary entry points: demo.py (single image pair), demo_with_segmentation.py (semantic-aware), and process_stylization_folder.py (batch). Pre-trained weights in PhotoWCTModels/ directory.

👥Who it's for

Computer vision researchers, visual effects artists, and ML engineers who need to apply artistic style transfer to photographs while maintaining photorealistic quality. Users need understanding of neural networks and access to NVIDIA GPUs (CUDA), as this is an NVIDIA research implementation focused on production-quality results.

🌱Maturity & risk

Mature research implementation (ECCV 2018 accepted paper, last meaningful commit circa 2018). Actively used in production contexts but development appears dormant—supports both Python 2.7 and 3.5 (indicating age), includes pre-trained models, and has shell demo scripts. No obvious CI/test suite visible in file list, suggesting academic-grade maturity rather than enterprise-grade robustness.

Primary risks: (1) PyTorch 0.4.0 requirement is outdated and may have breaking changes with modern versions; (2) No visible test suite or CI pipeline for regression testing; (3) Minimal maintenance signals—development essentially ceased post-2018; (4) Single-maintainer NVIDIA research code with no community contributor guidelines visible; (5) License is CC BY-NC-SA 4.0 (non-commercial restriction) limiting commercial deployment.

Active areas of work

No active development visible—repo appears archived. Last significant activity was PyTorch 0.4.0 migration (July 2018) and tutorial additions. No open PRs, issues, or recent commits indicated in the file structure provided.

🚀Get running

git clone https://github.com/NVIDIA/FastPhotoStyle.git && cd FastPhotoStyle && bash download_models.sh && python demo.py --content-image <path> --style-image <path>

Daily commands: Single image: python demo.py --content-image <path> --style-image <path> --output <path>. Batch folder: python process_stylization_folder.py --content-folder <path> --style-image <path> --output-folder <path>. With segmentation: python demo_with_ade20k_ssn.py --content <path> --style <path>. Shell examples in demo_example1.sh, demo_example3.sh.

🗺️Map of the codebase

  • photo_wct.py: Core algorithm implementing the Whitening and Coloring Transform—the mathematical heart of style transfer; must understand this to modify stylization behavior
  • process_stylization.py: Main orchestration script connecting feature extraction, WCT application, and post-processing; entry point for understanding the full pipeline
  • smooth_filter.py: Post-processing filter reducing photorealistic artifacts; critical for output quality since WCT alone produces visible halos
  • models.py: VGG19 feature extractor and pre-trained model loading; controls which layers extract style/content features
  • demo.py: Simplest end-to-end example showing input → stylization → output; best starting point for understanding the user-facing API
  • download_models.sh: Downloads photo_wct.pth pre-trained weights; must run successfully before any demo works

🛠️How to make changes

For style transfer logic: edit photo_wct.py (WCT transform implementation) or smooth_filter.py (artifact reduction). For I/O pipelines: edit converter.py (image reading/writing), process_stylization.py (core processing orchestration), or process_stylization_folder.py (batch handling). To add semantic features: extend demo_with_segmentation.py and process_stylization_ade20k_ssn.py. Model loading: modify download_models.py and models.py.

🪤Traps & gotchas

Critical: (1) photo_wct.pth model file (~100MB) must be downloaded via download_models.sh before running any demo—no automatic fallback; (2) Requires CUDA-capable GPU and NVIDIA drivers; CPU-only PyTorch will fail silently or crash; (3) PyTorch 0.4.0 is pinned—upgrading to 0.5+ or 1.x causes API breaks (.data accessor removed, .volatile deprecated); (4) ADE20K semantic mode requires separate ade20k_semantic_rel.npy file not in repo (see demo_with_ade20k_ssn.py imports); (5) No logging/error messages for mismatched image dimensions or missing files—failures are cryptic.

💡Concepts to learn

  • Whitening and Coloring Transform (WCT) — The mathematical core of FastPhotoStyle that aligns feature distributions between content and style—understanding WCT algebra (covariance, Cholesky decomposition) is essential to modifying stylization behavior or debugging artifacts
  • Instance Normalization vs. Batch Normalization — Determines whether VGG19 features are normalized per-instance or globally; affects how style statistics are computed in photo_wct.py and directly impacts output quality
  • Gram Matrix (Texture Descriptor) — Computes style statistics by flattening spatial dimensions and computing feature correlations; understanding this vs. WCT's covariance approach explains why FastPhotoStyle preserves photorealism better than naive neural style transfer
  • Bilateral Filtering / Edge-Preserving Smoothing — smooth_filter.py applies edge-aware blurring to remove stylization artifacts without blurring object boundaries; critical for maintaining photorealism in the final output
  • Feature Extraction (VGG19 Intermediate Layers) — Different VGG layers (relu3_4, relu4_4) capture different semantic levels (texture vs. structure); choosing which layers to apply WCT on directly controls stylization strength vs. content preservation
  • Semantic Segmentation (ADE20K) — demo_with_ade20k_ssn.py optionally applies region-specific styling based on scene semantics (sky, building, person); enables per-region style control beyond naive pixel-level transfer
  • CUDA Memory Management & Batch Processing — process_stylization_folder.py processes multiple images sequentially to avoid GPU out-of-memory errors; understanding VRAM constraints and layer-wise computation is essential for scaling to high-resolution or batch workloads
  • jcjohnson/fast-neural-style — Feed-forward CNN style transfer (earlier ICCV 2016 approach); faster inference but lower quality than WCT, useful baseline for comparing speed vs. quality tradeoffs
  • pytorch/examples — Official PyTorch neural style transfer tutorials; reference implementation for VGG feature extraction patterns used in FastPhotoStyle
  • facebookresearch/pix2pixHD — High-resolution conditional image-to-image synthesis; complementary conditional generation approach vs. FastPhotoStyle's feature-matching transfer
  • NVIDIA/StyleGAN — NVIDIA's follow-up generative model research (2018+); uses similar feature space concepts but for synthesis rather than transfer
  • NVlabs/SPADE — Semantic-aware image generation from masks; directly relevant to demo_with_ade20k_ssn.py semantic stylization branch

🪄PR ideas

To work on one of these in Claude Code or Cursor, paste: Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.

Add Python 3.6+ compatibility and remove Python 2.7 support

The README badges show Python 2.7 and 3.5 support, but Python 2.7 reached end-of-life in 2020. The repo likely has deprecated syntax. Testing against modern Python versions (3.8-3.11) and updating setup.py/requirements.txt would improve maintainability. The codebase needs a systematic audit for print statements, string handling, and division operators that differ between Python 2/3.

  • [ ] Add setup.py or pyproject.toml with python_requires='>=3.6' and list actual dependencies
  • [ ] Run 2to3 tool on all .py files and manually verify converter.py, models.py, photo_wct.py for Python 2 idioms
  • [ ] Update README.md to reflect Python 3.6+ support and remove Python 2.7 badge
  • [ ] Add GitHub Actions workflow testing against Python 3.8, 3.10, 3.11 to catch regressions

Add unit tests for core stylization modules

There are no test files in the repo. The critical modules (photo_wct.py, photo_smooth.py, smooth_filter.py, process_stylization.py) lack test coverage. Adding tests would catch PyTorch API changes, model loading issues, and image processing edge cases. This is especially important since the README mentions a migration to PyTorch 0.4.0.

  • [ ] Create tests/test_photo_wct.py with tests for model loading from PhotoWCTModels/photo_wct.pth and forward pass validation
  • [ ] Create tests/test_smooth_filter.py with tests for smooth_filter.py against sample image inputs
  • [ ] Create tests/test_process_stylization.py with integration tests using demo images to verify content+style transfer produces valid outputs
  • [ ] Add pytest configuration (pytest.ini or conftest.py) and update README with 'Running Tests' section

Document the ADE20K semantic segmentation pipeline with examples

The repo has two semantic segmentation scripts (demo_with_ade20k_ssn.py, process_stylization_ade20k_ssn.py) and a segmentation numpy file (ade20k_semantic_rel.npy), but TUTORIAL.md likely doesn't explain the semantic segmentation approach. Users can't easily understand when/how to use these vs. the basic demo.py. This adds significant value for advanced users.

  • [ ] Add a 'Semantic Segmentation' section to TUTORIAL.md explaining the difference between demo.py and demo_with_ade20k_ssn.py workflows
  • [ ] Create a new demo_ade20k_example.sh script with clear input/output paths for semantic segmentation stylization
  • [ ] Document in README what ade20k_semantic_rel.npy contains and how it's used in the segmentation pipeline
  • [ ] Add inline code comments to demo_with_ade20k_ssn.py and process_stylization_ade20k_ssn.py explaining the semantic mask integration steps

🌿Good first issues

  • Add automated test suite: Create tests/test_photo_wct.py with synthetic tensor inputs to verify WCT transform output ranges and gradients don't explode; currently zero test coverage visible
  • Port to modern PyTorch (1.9+): Update models.py and photo_wct.py to remove .data accessor patterns and replace .volatile=True with torch.no_grad(); document breaking changes in TUTORIAL.md
  • Document filter parameters: smooth_filter.py has hardcoded kernel sizes and sigma values with no explanation; add docstrings and a config file (e.g., config.yaml) with tunable smoothing parameters to process_stylization.py

Top contributors

Click to expand

📝Recent commits

Click to expand
  • af0c8fe — Add credit to Marco Forte for the compute lapacian function. (mingyuliutw)
  • 6f30665 — Update docker image and pynvrtc interface code (mingyuliutw)
  • af6b803 — Update TUTORIAL.md (Yijunmaverick)
  • c031e10 — Update TUTORIAL.md (Yijunmaverick)
  • 7fe52cd — Update TUTORIAL.md (Yijunmaverick)
  • 47ddce6 — Update TUTORIAL.md (Yijunmaverick)
  • 52860b8 — Add files via upload (Yijunmaverick)
  • 00970da — Merge branch 'master' of https://github.com/NVIDIA/FastPhotoStyle (mingyuliutw)
  • a325860 — Update TUTORIAL.md (Yijunmaverick)
  • ce9d8f8 — update gif (mingyuliutw)

🔒Security observations

Failed to generate security analysis.

LLM-derived; treat as a starting point, not a security audit.


Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.

Mixed signals · NVIDIA/FastPhotoStyle — RepoPilot