interactive-ui
Launch and operate the legacy PyQt4 iGAN interactive interface, drawing tools, candidate grid, slider, control panel, AverageExplorer, and ShadowDraw modes.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- interactive-ui
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Launch and operate the legacy PyQt4 iGAN interactive interface, drawing tools, candidate grid, slider, control panel, AverageExplorer, and ShadowDraw modes.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/controls-reference.md9.8 KB
- 参考文档references/troubleshooting.md12.2 KB
- 参考文档references/ui-workflows.md9.9 KB
- 脚本scripts/build_igan_command.py11.0 KB
03 SKILL.md 正文
interactive-ui
Use this sub-skill when the task is to open, configure, explain, or troubleshoot
iGAN_main.py, the PyQt4 interactive drawing interface for iGAN.
Read First
- For launch recipes and preflight commands, read references/ui-workflows.md.
- For what each visible widget, brush, slider, shortcut, and mode does, read references/controls-reference.md.
- For concrete failure diagnosis, read references/troubleshooting.md.
- For pretrained model files, sample generation smoke tests, and artifact URLs, route to ../model-inference/SKILL.md.
- For headless color/mask/edge-map constraint generation, route to ../constraint-generation/SKILL.md.
Use When
- The user wants a dry command for launching the iGAN GUI.
- The task mentions PyQt4, drawing pad, candidate results, color/sketch/warp brushes, slider interpolation, Play/Fix/Restart/Save/Edits, AverageExplorer, or ShadowDraw.
- The user asks how to operate the interactive interface once it appears.
- The user asks why the UI fails to open, opens blank, cannot import PyQt4, cannot find a display, cannot load a model, or does not update candidates.
- The user needs an optional native verification candidate for an interactive launch but has not asked to run a GPU/UI session yet.
Do Not Use When
- The user only wants non-UI generation from color masks and edge maps; use ../constraint-generation/SKILL.md.
- The user asks to download DCGAN/AlexNet artifacts or generate sample grids; use ../model-inference/SKILL.md.
- The user asks to train DCGAN models, create HDF5 datasets, or pack training checkpoints; use ../training-data/SKILL.md.
- The user asks to project an image into latent space; use the projection sub-skill if present, not this UI router.
- The user asks to modernize or port the code to a new framework; this sub-skill can identify UI dependencies, but it does not own a rewrite plan.
Runtime Facts To Preserve
iGAN_main.pyis a legacy script that imports PyQt4, qdarkstyle, Theano model definitions, and a framework-specific constrained optimizer during startup.- The documented runtime assumes Python2-era packages, Theano, OpenCV, CUDA, cuDNN, and a desktop display or VNC session.
- The default model command uses
--model_name outdoor_64and resolves the model file to./models/<model_name>.<model_type>when--model_fileis omitted. --model_typedefaults todcgan_theano;--frameworkdefaults totheanoand selectsconstrained_opt_theanothrough dynamic lookup.--top_kcontrols the maximum number of candidate thumbnails;--batch_sizecontrols random initial latent samples used by optimization.--n_iterscontrols per-edit constrained optimization iterations; real-time behavior depends on a compatible GPU stack.--morph_stepscontrols slider/playback frames between the previous result and the current edited result.--averageenables AverageExplorer display, where the main pad may show a weighted average of candidate results.--shadowenables ShadowDraw-style sketch assistance and disables color and warp buttons in favor of sketching.hed_shoes_64is the documented model for ShadowDraw and should normally be combined with--shadow --average.
Build Launch Commands Safely
Use the bundled dry-run helper instead of importing or executing the GUI:
python sub-skills/interactive-ui/scripts/build_igan_command.py --help
python sub-skills/interactive-ui/scripts/build_igan_command.py \
--model-name outdoor_64 --check-display
For ShadowDraw with AverageExplorer:
python sub-skills/interactive-ui/scripts/build_igan_command.py \
--model-name hed_shoes_64 --shadow --average --check-display
The helper prints the THEANO_FLAGS environment and python iGAN_main.py ...
command but never launches PyQt4, never loads a model, never downloads files,
and never touches CUDA.
Launch Readiness Checklist
Before telling the user to run the command, confirm these facts from references/ui-workflows.md:
- A compatible Python/PyQt4/OpenCV/qdarkstyle stack is active.
- The requested pretrained model file exists under the expected
models/path or the user supplied--model_file. - The display is available through local X11, VNC, Xpra, or another remote
desktop path; a bare SSH shell without
DISPLAYis not enough. THEANO_FLAGSselects the intended device, usuallydevice=gpu0,floatX=float32for the legacy real-time path.- The user understands that modern Python and modern CUDA may need pinning, compatibility shims, or a container built for the old Theano stack.
Operate The UI
- Explain the window as a drawing pad on the left and a candidate grid on the right; details live in references/controls-reference.md.
- For color edits, choose Coloring, right-click the color chip or pad to select a color, drag with left mouse, and use the wheel to change brush width.
- For shape edits, choose Sketching and drag with left mouse; in ShadowDraw mode this is the primary enabled tool and color toggles between black and white.
- For warping, first create color/sketch constraints, right-click a square source patch, then left-drag the patch target; use the wheel for patch size.
- Candidate thumbnails update during constrained optimization; click a thumbnail to select it for the main drawing pad.
- The slider and Play button inspect morph frames after an edit; Fix promotes the current image/frame as the next latent starting point.
- Restart clears the UI state; Save writes an HTML/image result in the user-chosen output folder after the first save dialog.
- Keyboard shortcuts include
P,F,R,S,E,A, andQ.
Troubleshooting Routing
- If import fails before a window appears, start with dependency and Python version rows in references/troubleshooting.md.
- If a Qt error says no platform/display is available, diagnose display/VNC setup before touching Theano or model files.
- If the window opens but candidates never update, inspect CUDA/Theano/model
loading, the
constrained_opt_theanodynamic import, and optimizer logs. - If ShadowDraw is requested with a non-sketch model, recommend
hed_shoes_64or explain that other models may not provide useful sketch guidance. - If the user wants to bypass the UI after display problems, route to ../constraint-generation/SKILL.md.
Native Verification Candidate
Preserve the optional native case as a blocked/unverified runtime launch unless all prerequisites are available:
THEANO_FLAGS='device=gpu0,floatX=float32,nvcc.fastmath=True' \
python iGAN_main.py --model_name outdoor_64
Expected signal: a PyQt4 window titled Interactive GAN opens, model arguments
print to stdout, the candidate grid updates after a stroke, and quitting with
Q exits the application. Do not run this case in an automated verification
session without explicit UI, model-file, and GPU approval.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).