How akmalhfzh/image_inpainting_gan works
This repository implements an image-inpainting Context Encoder GAN, spanning PyTorch training and inference, fixed-point weight preparation, a custom Verilog accelerator, and PYNQ deployment. The main user workflow is to provide an image, mask a region, run generator inference, and obtain a completed image; the training-to-hardware path prepares weights for the FPGA. The README documents these capabilities, but most RTL and deployment internals were not excerpted, so the graph avoids asserting unsampled module-level call relationships.
Main entry points: pynq_runner.py PYNQ Runner · train.py GAN Training · extract_weights.py Weight Export · models.py GAN Models
Components 20
Model and Training
- GAN Training
Model_Training_and_Inference/train/train.py - GAN Models
Model_Training_and_Inference/train/models.py - Software Inference
Model_Training_and_Inference/train/inference.py - Weight Export
Model_Training_and_Inference/train/extract_weights.py
FPGA Accelerator
- RTL Weight Images
Hardware_Design/weight_hex - Generator Top
Hardware_Design/rtl/generator_top.v - AXI Wrapper
Hardware_Design/rtl/gan_axi_wrapper.v - Convolution Engine
Hardware_Design/rtl/conv_unified.v - MAC Array
Hardware_Design/rtl/mac_array.v - Batch Normalization
Hardware_Design/rtl/batchnorm2d.v - Activations
Hardware_Design/rtl
PYNQ Deployment
- PYNQ Runner
Software_Deployment/USB_GAN/pynq_runner.py - Mask Utilities
Software_Deployment/USB_GAN/apply_mask.py
Verification
- Reference Model
Verification_and_Scripts/verify/models.py - Reference Inference
Verification_and_Scripts/verify/inference.py - Output Checks
Verification_and_Scripts/verify/check_gen.py - RTL Visualization
Verification_and_Scripts/verify/visualize_rtl_hex.py
Other components
- Image User
- Zynq FPGA
- Inpainted Image
Connections 11
- GAN Training → GAN Models: trains
Model_Training_and_Inference/train/train.py - Software Inference → GAN Models: runs generator
Model_Training_and_Inference/train/inference.py - GAN Training → Weight Export: exports weights
- Weight Export → RTL Weight Images: writes hex
- Image User → PYNQ Runner: submits image
README.md - PYNQ Runner → Zynq FPGA: runs accelerator
README.md - Mask Utilities → PYNQ Runner: prepares mask
- Zynq FPGA → Inpainted Image: returns image
README.md - Reference Inference → Reference Model: runs reference
Verification_and_Scripts/verify/inference.py - Output Checks → Inpainted Image: checks output
- RTL Visualization → Inpainted Image: visualizes layers