diff --git a/README.md b/README.md index df09d1e..0bd0d83 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,9 @@ You can star this repository to keep track of the project if it's helpful for yo # Install +#### Preparation +- [Pytorch](https://pytorch.org/get-started/previous-versions/): To apply some of the supported beautifiers (e.g., cartoongan), you need to install pytorch and corresponding dependencies following [tutorial](https://pytorch.org/get-started/previous-versions/). + #### Pip install ```sh run "pip install pydrawing" diff --git a/docs/Author.md b/docs/Author.md new file mode 100644 index 0000000..8cdcb65 --- /dev/null +++ b/docs/Author.md @@ -0,0 +1,15 @@ +# 关于作者 + +``` +学生党, 主要研究方向是计算机视觉, 顺便对信息安全感兴趣。 + +我的个人微信公众号是: Charles_pikachu (欢迎搜索关注,或者搜"Charles的皮卡丘") + +我的Github账号是: https://github.com/CharlesPikachu + +我的知乎账号是: https://www.zhihu.com/people/charles_pikachu + +我的B站账号是: https://space.bilibili.com/406756145 + +个人邮箱: charlesblwx@gmail.com +``` \ No newline at end of file diff --git a/docs/Changelog.md b/docs/Changelog.md new file mode 100644 index 0000000..15595c1 --- /dev/null +++ b/docs/Changelog.md @@ -0,0 +1,3 @@ +# 开发日志 + +- 2022-01-18: 完成v0.1.0, 支持多种图像/视频美化算法。 \ No newline at end of file diff --git a/docs/Install.md b/docs/Install.md new file mode 100644 index 0000000..3c40d5b --- /dev/null +++ b/docs/Install.md @@ -0,0 +1,37 @@ +# 安装Pydrawing + + +## 环境配置 +- 操作系统: Linux or macOS or Windows +- Python版本: Python3.6+ +- Pytorch: 若需要使用CartoonGan等算法, 需要安装Pytorch>=1.0.0和配置对应的环境, 详见[官方文档](https://pytorch.org/get-started/locally/)。 + + +## PIP安装(推荐) +在终端运行如下命令即可(请保证python在环境变量中): +```sh +pip install pydrawing --upgrade +``` + + +## 源代码安装 + +#### 在线安装 +运行如下命令即可在线安装: +```sh +pip install git+https://github.com/CharlesPikachu/pydrawing.git@master +``` + +#### 离线安装 +利用如下命令下载pydrawing源代码到本地: +```sh +git clone https://github.com/CharlesPikachu/pydrawing.git +``` +接着, 切到pydrawing目录下: +```sh +cd pydrawing +``` +最后运行如下命令进行安装: +```sh +python setup.py install +``` \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/Quickstart.md b/docs/Quickstart.md new file mode 100644 index 0000000..185d29e --- /dev/null +++ b/docs/Quickstart.md @@ -0,0 +1,24 @@ +# 快速开始 + + +## 已经支持的算法 + +#### 图像卡通化 +#### 铅笔素描画 +#### 卡通GAN + + +## 随机运行一个小程序 +写如下代码,保存并运行即可: +```python +import random +from pydrawing import pydrawing + +filepath = 'asserts/input.jpg' +config = { + "savedir": "outputs", + "savename": "output" +} +drawing_client = pydrawing() +drawing_client.execute(filepath, random.choice(drawing_client.getallsupports())) +``` \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..a97f516 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,72 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'pydrawing' +copyright = '2022, Zhenchao Jin' +author = 'Zhenchao Jin' +release = '0.1.0' + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.napoleon', + 'sphinx.ext.viewcode', + 'recommonmark', + 'sphinx_markdown_tables', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +source_suffix = { + '.rst': 'restructuredtext', + '.md': 'markdown', +} + +# The master toctree document. +master_doc = 'index' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'sphinx_rtd_theme' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# For multi language +# locale_dirs = ['locale/'] +# gettext_compact = False \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..4bf449f --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,15 @@ +.. pydrawing documentation master file, created by + sphinx-quickstart on Sat Feb 29 22:07:23 2020. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Pydrawing中文文档 +======================================== + +.. toctree:: + :maxdepth: 2 + + Install.md + Quickstart.md + Changelog.md + Author.md \ No newline at end of file diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..9534b01 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..bbb1cb7 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +recommonmark +sphinx +sphinx_markdown_tables +sphinx_rtd_theme \ No newline at end of file