Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesPikachu committed Jan 18, 2022
1 parent 6b88120 commit d98e1e4
Show file tree
Hide file tree
Showing 10 changed files with 228 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 15 additions & 0 deletions docs/Author.md
Original file line number Diff line number Diff line change
@@ -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
个人邮箱: [email protected]
```
3 changes: 3 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 开发日志

- 2022-01-18: 完成v0.1.0, 支持多种图像/视频美化算法。
37 changes: 37 additions & 0 deletions docs/Install.md
Original file line number Diff line number Diff line change
@@ -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
```
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -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)
24 changes: 24 additions & 0 deletions docs/Quickstart.md
Original file line number Diff line number Diff line change
@@ -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()))
```
72 changes: 72 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -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
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
recommonmark
sphinx
sphinx_markdown_tables
sphinx_rtd_theme

0 comments on commit d98e1e4

Please sign in to comment.