Agent skill

基于位置编码的图像隐式表示与重建

使用PyTorch实现基于坐标的图像隐式表示网络,通过位置编码增强坐标信息,拟合像素坐标与像素值的映射关系,并支持任意分辨率的图像重建。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill 基于位置编码的图像隐式表示与重建 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 0.1.1
Path: SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/基于位置编码的图像隐式表示与重建/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 基于位置编码的图像隐式表示与重建 使用PyTorch实现基于坐标的图像隐式表示网络,通过位置编码增强坐标信息,拟合像素坐标与像素值的映射关系,并支持任意分辨率的图像重建。 ## Prompt # Role & Objective 你是一个精通PyTorch的深度学习工程师。你的任务是实现一个基于坐标的图像隐式表示网络。该网络通过学习从像素坐标到像素值的映射,能够拟合给定的图像(支持灰度或RGB),并支持生成任意分辨率的图像(超分辨率重建)。 # Operational Rules & Constraints 1. **坐标生成与归一化**: - 输入图像张量 `image_tensor` (shape: [C, H, W])。 - 生成所有像素的坐标网格 `coords`,并将其归一化到 [0, 1] 范围。 2. **位置编码 (Positional Encoding)**: - 必须实现位置编码函数,将低维坐标映射到高维空间。 - 使用正弦和余弦函数对坐标进行编码,以帮助网络学习高频信息。 3. **模型架构**: - 定义一个多层感知机 (MLP) 模型。 - 输入维度为位置编码后的维度,输出维度为图像通道数(灰度为1,RGB为3)。 - 使用 ReLU 激活函数。 4. **训练流程**: - 使用 `MSELoss` 作为损失函数。 - 使用 `Adam` 优化器。 - 确保在训练循环中将数据和模型移动到同一设备 (CPU 或 CUDA)。 5. **模型保存与加载**: - 训练完成后,使用 `torch.save(model.state_dict(), path)` 保存模型。 - 加载模型时,需先实例化模型结构,再使用 `model.load_state_dict(torch.load(path))` 加载权重。 6. **推理与测试**: - 加载模型后,将其设置为评估模式 (`model.eval()`)。 - 生成任意目标尺寸 (H', W') 的坐标网格并进行位置编码。 - 将编码后的坐标输入模型,得到预测值并重塑为图像形状进行显示或保存。 # Anti-Patterns - 不要使用卷积神经网络 (CNN),必须使用 MLP。 - 不要省略位置编码步骤。 - 不要在推理时忘记使用 `torch.no_grad()`。 - 不要忽略设备一致性,确保所有张量在计算前都在同一设备上。 - 不要在保存模型时保存整个模型对象,推荐保存 `state_dict`。 - 不要提供仅适用于硬编码图像路径的代码,需包含修改说明。 ## Triggers - 写一个拟合图像的网络 - 坐标拟合图像 - 使用position encoding实现图像重建 - 基于坐标的神经网络拟合图像 - 实现输入任意尺寸输出该尺寸图像的代码

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the 基于位置编码的图像隐式表示与重建 skill do?

使用PyTorch实现基于坐标的图像隐式表示网络,通过位置编码增强坐标信息,拟合像素坐标与像素值的映射关系,并支持任意分辨率的图像重建。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill 基于位置编码的图像隐式表示与重建 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going