All Projects → GordonRen → edge2view

GordonRen / edge2view

Licence: MIT license
This is a pix2pix demo that learns from edge and translates this into view. A interactive application is also provided that translates edge to view.

Programming Languages

python
139335 projects - #7 most used programming language
matlab
3953 projects

Projects that are alternatives of or similar to edge2view

Pose2pose
This is a pix2pix demo that learns from pose and translates this into a human. A webcam-enabled application is also provided that translates your pose to the trained pose. Everybody dance now !
Stars: ✭ 182 (+727.27%)
Mutual labels:  pix2pix, generative-adversarial-networks
Zi2zi
Learning Chinese Character style with conditional GAN
Stars: ✭ 1,988 (+8936.36%)
Mutual labels:  pix2pix, generative-adversarial-networks
Pytorch Pix2pix
Pytorch implementation of pix2pix for various datasets.
Stars: ✭ 74 (+236.36%)
Mutual labels:  pix2pix, generative-adversarial-networks
edge detector
HED real-time iOS edge detector.
Stars: ✭ 40 (+81.82%)
Mutual labels:  edge-detection, hed
lin-im2im
Linear image-to-image translation
Stars: ✭ 39 (+77.27%)
Mutual labels:  pix2pix
Pix2Pix-Keras
基于pix2pix模型的动漫图片自动上色(keras实现) 2019-2-25
Stars: ✭ 95 (+331.82%)
Mutual labels:  pix2pix
spark-convolution-patch
Convolution and other super-patches (blur, sharpen)
Stars: ✭ 74 (+236.36%)
Mutual labels:  edge-detection
images-processing
Project of computational mathematics, image processing, eliminating the noise of an image, reflection of an image and canny filter
Stars: ✭ 23 (+4.55%)
Mutual labels:  edge-detection
DeepSegmentor
A Pytorch implementation of DeepCrack and RoadNet projects.
Stars: ✭ 152 (+590.91%)
Mutual labels:  edge-detection
Edge-Detection-project
Tiny Image in Javascript - Edge Detection Algorithms
Stars: ✭ 27 (+22.73%)
Mutual labels:  edge-detection
gcWGAN
Guided Conditional Wasserstein GAN for De Novo Protein Design
Stars: ✭ 38 (+72.73%)
Mutual labels:  generative-adversarial-networks
gan-vae-pretrained-pytorch
Pretrained GANs + VAEs + classifiers for MNIST/CIFAR in pytorch.
Stars: ✭ 134 (+509.09%)
Mutual labels:  generative-adversarial-networks
OASIS
Official implementation of the paper "You Only Need Adversarial Supervision for Semantic Image Synthesis" (ICLR 2021)
Stars: ✭ 232 (+954.55%)
Mutual labels:  generative-adversarial-networks
pytorch-gan
GAN model using PyTorch
Stars: ✭ 38 (+72.73%)
Mutual labels:  generative-adversarial-networks
cfg-gan
CFG-GAN: Composite functional gradient learning of generative adversarial models
Stars: ✭ 15 (-31.82%)
Mutual labels:  generative-adversarial-networks
pcl-edge-detection
Edge-detection application with PointCloud Library
Stars: ✭ 32 (+45.45%)
Mutual labels:  edge-detection
GAN-keras
tensorflow2.x implementations of Generative Adversarial Networks.
Stars: ✭ 30 (+36.36%)
Mutual labels:  generative-adversarial-networks
stylegan-v
[CVPR 2022] StyleGAN-V: A Continuous Video Generator with the Price, Image Quality and Perks of StyleGAN2
Stars: ✭ 136 (+518.18%)
Mutual labels:  generative-adversarial-networks
Awesome-Edge-Detection-Papers
📚 A collection of edge/contour/boundary detection papers and toolbox.
Stars: ✭ 927 (+4113.64%)
Mutual labels:  edge-detection
WebSight
Aiding the visually impaired through real time augmented reality, AI object detection, WebGL shaders effects such as edge detection, and colour adjustments.
Stars: ✭ 26 (+18.18%)
Mutual labels:  edge-detection

edge2view-demo

This is a pix2pix demo that learns from edge and translates this into view. A interactive application is also provided that translates edge to view.

Getting Started

1. Prepare Environment

# Clone this repo
git clone [email protected]:GordonRen/edge2view.git

# Create the conda environment from file
conda env create -f environment.yml

2. Configure Holistically-Nested Edge Detection

https://github.com/s9xie/hed

3. Generate Original Data

python generate_train_data.py --file Desert.mp4

Input:

  • file is the name of the video file from which you want to create the data set.

Output:

  • One folder original will be created.

4. Generate Edge Data

  • generate edge data by following batch_hed.py and put the edge data into hed_edge.

example

If you want to download my dataset, here is also the video file that I used and the generated training dataset (708 images already split into training and validation).

5. Train Model

# Clone the repo from Christopher Hesse's pix2pix TensorFlow implementation
git clone https://github.com/affinelayer/pix2pix-tensorflow.git

# Move the original and hed_edge folder into the pix2pix-tensorflow folder
mv edge2view/hed_edge edge2view/original pix2pix-tensorflow/photos_view

# Go into the pix2pix-tensorflow folder
cd pix2pix-tensorflow/

# Reset to april version
git reset --hard d6f8e4ce00a1fd7a96a72ed17366bfcb207882c7

# Resize original images
python tools/process.py \
  --input_dir photos_view/original \
  --operation resize \
  --output_dir photos_view/original_resized
  
# Resize hed_edge images
python tools/process.py \
  --input_dir photos_view/hed_edge \
  --operation resize \
  --output_dir photos_view/hed_edge_resized
  
# Combine both resized original and hed_edge images
python tools/process.py \
  --input_dir photos_view/hed_edge_resized \
  --b_dir photos_view/original_resized \
  --operation combine \
  --output_dir photos_view/combined
  
# Split into train/val set
python tools/split.py \
  --dir photos_view/combined
  
# Train the model on the data
python pix2pix.py \
  --mode train \
  --output_dir edge2view-model \
  --max_epochs 1000 \
  --input_dir photos_view/combined/train \
  --which_direction AtoB

For more information around training, have a look at Christopher Hesse's pix2pix-tensorflow implementation.

6. Export Model

  1. First, we need to reduce the trained model so that we can use an image tensor as input:

    python reduce_model.py --model-input edge2view-model --model-output edge2view-reduced-model
    

    Input:

    • model-input is the model folder to be imported.
    • model-output is the model (reduced) folder to be exported.

    Output:

    • It returns a reduced model with less weights file size than the original model.
  2. Second, we freeze the reduced model to a single file.

    python freeze_model.py --model-folder edge2view-reduced-model
    

    Input:

    • model-folder is the model folder of the reduced model.

    Output:

    • It returns a frozen model file frozen_model.pb in the model folder.

I have uploaded a pre-trained frozen model here. This model is trained on 708 images with epoch 1000.

7. Run Demo

python edge2view.py --tf-model edge2view-reduced-model/frozen_model.pb

Input:

  • tf-model is the frozen model file.

Example:

example

Requirements

Acknowledgments

Kudos to Christopher Hesse for his amazing pix2pix TensorFlow implementation and Gene Kogan for his inspirational workshop.
Inspired by Dat Tran.

License

See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].