Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INP — Implicit Neural Representation for Image Compression & Super-Resolution

用隐式神经表示(INP)对单张灰度图像进行参数化拟合,系统探索激活函数、位置编码、网络架构、SIREN 正弦网络等因素对重建质量的影响。

项目结构

INP/
├── data/                   # 输入图像
│   ├── synthetic/          # 合成几何图形(circle/sqaure/triangle)
│   ├── arona_o_gray_edges_x0.3.jpg  # Arona 线稿(主测试图)
│   ├── t2.png              # 中等复杂度线稿(验证用)
│   └── shapes_128_gray.png # 合成图形 128²
├── src/                    # 源代码
│   ├── train_grayscale.py  # 主训练脚本(MLP + PE + SIREN + Warmup)
│   ├── reconstruct.py      # 重建 / 超分辨率
│   ├── visualize.py        # 多实验 PSNR/Loss 曲线对比
│   ├── experiment_queue.py # 批量实验运行器
│   ├── rerun_baselines.py  # 基线重跑脚本
│   ├── count_params.py     # 参数量计算
│   └── generation/         # 合成图形生成脚本
├── outputs/                # 实验结果
│   ├── runs/               # 各实验的模型权重 + metrics.json
│   └── final_report/       # 报告用对比图(14 组)
├── doc/                    # 课程项目报告 & PPT
│   ├── 课程项目报告.md
│   ├── 课程项目报告.pdf
│   └── p.pptx
└── requirements.txt

快速开始

# 创建虚拟环境
python -m venv .venv
.venv\Scripts\Activate.ps1   # Windows
pip install -r requirements.txt

# 训练一个基础 MLP(无 PE)
python src/train_grayscale.py data/shapes_128_gray.png

# 训练 + 位置编码 L=8
python src/train_grayscale.py data/shapes_128_gray.png --pe det --pe-layers 8

# SIREN 正弦网络
python src/train_grayscale.py data/arona_o_gray_edges_x0.3.jpg --act sin --lr 2e-4 --warmup-steps 1000 --iters 20000

# 超分辨率重建(2×)
python src/reconstruct.py outputs/runs/<run_dir> --out-w 900 --out-h 1800

# 对比多个实验的训练曲线
python src/visualize.py outputs/runs/run1 outputs/runs/run2 --labels "ReLU" "SIREN"

环境要求

  • Python 3.10+
  • PyTorch ≥ 2.0(CUDA 可选,GPU 可大幅加速)
  • 详见 requirements.txt

About

A learning project exploring 'Implicit Neural Representations'

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages