L’interface est localisée ; les présentations et documents des Skills sont traduits automatiquement par IA dans votre langue. Le code, les commandes, chemins et termes techniques restent en version originale, et le document de l’auteur fait foi.
Explorer les Skills
Productivité · SKILL.md

model-internals

model-internals

Explain and verify the photo2cartoon generator, discriminator, normalization layers, face-ID feature path, tensor utilities, and checkpoint structure.

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentation de la Skill

GitHub

name: model-internals description: "Explain and verify the photo2cartoon generator, discriminator, normalization layers, face-ID feature path, tensor utilities, and checkpoint structure." disable-model-invocation: true metadata: disco-role: operating license: MIT

Model Internals

Use this sub-skill for the model core only: architecture, forward signatures, normalization layers, checkpoint contents, and safe synthetic verification.

Start here

  • Architecture reference for generator/discriminator tuples, hourglass topology, Soft-AdaLIN / LIN behavior, CAM heatmaps, and verified smoke shapes.
  • Training object reference for UgatitSadalinHourglass, losses, optimizer setup, checkpoint keys, and save/load behavior.
  • Face ID loss reference for FaceFeatures, MobileFaceNet cropping, 112×112 embeddings, and cosine-distance loss.
  • Image and tensor utilities for normalization range, CAM rendering, and helper semantics.
  • Troubleshooting for shape mismatch, checkpoint key errors, deprecated F.upsample, device mismatch, and missing face-ID assets.
  • Synthetic smoke for safe forward checks and optional checkpoint/face-ID validation.

Route elsewhere

  • Inference commands, asset download steps, and end-user cartoon generation workflows -> ../portrait-inference/
  • Face detection, alignment, crop, and segmentation details -> ../preprocessing/
  • Dataset layout, preprocessing batches, CLI training, and long-running optimization -> ../data-and-training/

What this sub-skill covers

  • ResnetGenerator, Discriminator, HourGlass, HourGlassBlock, ResnetBlock, ResnetSoftAdaLINBlock, SoftAdaLIN, adaLIN, and LIN
  • Generator and discriminator return tuples: (out, cam_logit, heatmap)
  • CAM logits and heatmap interpretation
  • Tensor normalization range used by the repo
  • Face-ID embedding path through MobileFaceNet(512)
  • Training checkpoint contents and safe load checks
  • Safe synthetic verification only; no downloads, no training, no destructive writes

Practical commands

python scripts/model_forward_smoke.py --help
python scripts/model_forward_smoke.py --repo-root /path/to/photo2cartoon
python scripts/model_forward_smoke.py --repo-root /path/to/photo2cartoon --checkpoint /path/to/checkpoint.pt --face-model /path/to/model_mobilefacenet.pth
Skills enregistrées