Skip to content

usingnamespacestc/sketchKeras-pytorch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sketchKeras-pytorch

Unofficial implementation of sketchKeras in pytorch. sketchKeras is for extracting the sketch from a painting.
I translated the original implementation in keras to the pytorch code and also converted the weight file.

Usage

Place the weight file in weights directory.
The weight file can be downloaded here.

For processing, place the pictures in folder 'read' and then run the following command.

python main.py

Explanation of some args.

'--ratio', type=float, default=0.95,
The rate one pictures will be placed in 'train' folder. Otherwise it will be used as val.


'--size_limit', type=int, default=1536,
If the resolution of the image is too high, the image will be resized to a proper size around this number.

If you are interested in the way to convert the weight file of the original implementation to this project, see src/fromkeras.py

Examples

This program works with pictures at ANY resolution. (Pictrues are from Internet. If there is a copyright infringement, please contact me to delete them.)

First: original image
Second: gray image
Third: result of sketchKeras

(My) Environments

  • python (3.7.7)
  • numpy
  • torch (1.6.0)
  • opencv-python (4.4.0.42)

About

My implementation of sketchKeras in pytorch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%