Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add requirements.txt #84

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

cartoonbox/input/*
cartoonbox/output/*
13 changes: 13 additions & 0 deletions INSTALLATION GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Prerequisites for Windows 10:

Python 3.7.9 (64 bit) (You CAN'T use Python 3.9)
ffmepg (make sure it's on your PATH)


commands:

python -m venv env

(activate environment)

pip install -r requirements.txt
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@

### Inference with Pre-trained Model

- Store test images in /test_code/test_images
- Run /test_code/cartoonize.py
- Results will be saved in /test_code/cartoonized_images
- Store test images in /cartoonbox/test_images
- Run /cartoonbox/cartoonize.py
- Results will be saved in /cartoonbox/cartoonized_images


### Train
Expand Down
4 changes: 2 additions & 2 deletions test_code/cartoonize.py → cartoonbox/cartoonize.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import cv2
import numpy as np
import tensorflow as tf
import network
import guided_filter
from cartoonbox import network
from cartoonbox import guided_filter
from tqdm import tqdm


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
absl-py==0.13.0
astor==0.8.1
cached-property==1.5.2
cloudpickle==1.6.0
colorama==0.4.4
decorator==4.4.2
ffmpeg==1.4
gast==0.2.2
google-pasta==0.2.0
grpcio==1.39.0
h5py==3.3.0
importlib-metadata==4.6.1
install==1.3.4
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
Markdown==3.3.4
networkx==2.5.1
numpy==1.19.5
opencv-python==4.5.3.56
opt-einsum==3.3.0
Pillow==8.3.1
protobuf==3.17.3
PyWavelets==1.1.1
scikit-image==0.14.5
six==1.16.0
tensorboard==1.15.0
tensorflow==1.15.0
tensorflow-estimator==1.15.1
tensorflow-gpu==1.15.0
termcolor==1.1.0
tqdm==4.61.2
typing-extensions==3.10.0.0
Werkzeug==2.0.1
wrapt==1.12.1
zipp==3.5.0
10 changes: 10 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import os
from cartoonbox.cartoonize import cartoonize

model_path = './cartoonbox/models'
load_folder = './cartoonbox/input'
save_folder = './cartoonbox/output'

if not os.path.exists(save_folder):
os.mkdir(save_folder)
cartoonize(load_folder, save_folder, model_path)
Binary file removed test_code/test_images/actress2.jpg
Binary file not shown.
Binary file removed test_code/test_images/china6.jpg
Binary file not shown.
Binary file removed test_code/test_images/food16.jpg
Binary file not shown.
Binary file removed test_code/test_images/food6.jpg
Binary file not shown.
Binary file removed test_code/test_images/liuyifei4.jpg
Binary file not shown.
Binary file removed test_code/test_images/london1.jpg
Binary file not shown.
Binary file removed test_code/test_images/mountain4.jpg
Binary file not shown.
Binary file removed test_code/test_images/mountain5.jpg
Binary file not shown.
Binary file removed test_code/test_images/national_park1.jpg
Binary file not shown.
Binary file removed test_code/test_images/party5.jpg
Binary file not shown.
Binary file removed test_code/test_images/party7.jpg
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes