计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
image-projection【效率与协作】Project an image into iGAN latent space and reconstruct it with iGAN_predict.py, safe command builders, AlexNet planning, and projection troubleshooting.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when the task is to project a real image into the latent space of an iGAN DCGAN model and save the reconstructed image.
This router covers the iGAN_predict.py workflow, the solver choices
cnn, opt, and cnn_opt, the AlexNet conv4 feature dependency used by the
published command, and the model-file requirements for predictor parameters.
Do not use this sub-skill for random sampling, downloading DCGAN model-zoo artifacts, interactive editing, non-UI constraint maps, or training the predictor network. Route those tasks to sibling skills instead.
Use this sub-skill for tasks such as:
iGAN_predict.py command for a given input image.cnn, opt, and cnn_opt projection solvers.conv4 pickle target without performing a download.Projection is a legacy native workflow. Before proposing a runtime run, confirm:
iGAN_predict.py.models/<model_name>.<model_type> or the user supplies --model_file.models/caffe_reference_conv4.pkl for the default feature layer.If any runtime artifact is missing, use the bundled dry-run helpers and references instead of attempting a native GPU run.
For most tasks, first build a dry command:
python sub-skills/image-projection/scripts/build_projection_command.py \
--model-name shoes_64 \
--input-image pics/shoes_test.png \
--solver cnn_opt
For a custom pure optimization command with an explicit output path:
python sub-skills/image-projection/scripts/build_projection_command.py \
--model-name shoes_64 \
--input-image inputs/shoe.png \
--solver opt \
--output-image outputs/shoe_opt.png
The helper prints a command only. It never imports Theano, opens images, uses a GPU, starts training, or downloads files.
The documented projection command uses AlexNet conv4 features. Plan the URL
and local target without network side effects:
python sub-skills/image-projection/scripts/igan_alexnet_urls.py --layer conv4
The planner only reports URLs and expected targets. It does not download AlexNet, DCGAN models, or predictor parameters.
When all artifacts and the legacy runtime are available, the command pattern is:
THEANO_FLAGS='device=gpu0,floatX=float32,nvcc.fastmath=True' \
python iGAN_predict.py \
--model_name shoes_64 \
--input_image pics/shoes_test.png \
--solver cnn_opt
If --output_image is omitted and the input filename contains .png, the
script writes beside the input as <input_stem>_<solver>.png. For example,
pics/shoes_test.png with cnn_opt becomes pics/shoes_test_cnn_opt.png.
cnn: fastest feed-forward projection through the trained predictor network; requires usable predictor params.opt: L-BFGS-B latent optimization against pixel and feature reconstruction losses; slower and still compiled through the current predictor-aware setup.cnn_opt: default hybrid; starts from the predictor and refines with L-BFGS-B; best documented quality.Prefer cnn_opt unless the user explicitly requests speed (cnn) or a custom
optimization baseline (opt). Reject unknown solver strings before runtime; the
source script does not validate them robustly.
A successful run prints parsed arguments, reads one image, compiles Theano
functions, loads the model and AlexNet feature network, reconstructs one image,
and saves the result to --output_image or the default solver-suffixed PNG path.
The output image is a reconstructed RGB image resized back to the original input dimensions. The script does not save the optimized latent vector by default.
Before telling a user a projection is ready to run, verify or explicitly mark unknown:
iGAN_predict.py is available in the working runtime checkout.models/<model_name>.<model_type> or the supplied --model_file exists.models/caffe_reference_conv4.pkl exists for the default projection path.lib/ilsvrc_2012_mean.npy exists with the local iGAN library files.cnn or cnn_opt, and preferably even for opt because the original script compiles the predictor unconditionally.If native execution fails, classify the symptom first:
Keep this sub-skill focused on image projection only. It may refer to DCGAN model
files and predictor parameters as required inputs, but it does not own model-zoo
downloads, predictor training, or model packing. It may mention AlexNet conv4
because the projection loss depends on it, but network downloads must remain a
manual user action planned by the bundled URL helper.