Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
huhudev-git committed Nov 25, 2020
1 parent 2fdc6d4 commit ad5f038
Showing 1 changed file with 25 additions and 34 deletions.
59 changes: 25 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ flask run

| name | type | description |
| :----------- | :----- | :----------------------------- |
| mosaic-type | string | リクエストのモザイクのパターン |
| mosaic-style | string | リクエストのモザイクのスタイル |
| mosaic_type | string | リクエストのモザイクのパターン |
| mosaic_style | string | リクエストのモザイクのスタイル |
| image | blob | 画像の内容 |

#### レスポンス
Expand Down Expand Up @@ -123,6 +123,13 @@ flask run
> - [Blur and anonymize faces with OpenCV and Python](https://www.pyimagesearch.com/2018/02/26/face-detection-with-opencv-and-deep-learning/)
> - [Face detection with OpenCV and deep learning](https://www.pyimagesearch.com/2020/04/06/blur-and-anonymize-faces-with-opencv-and-python/)
`pixelate/face_detect/main.py`

```py
def face_detect(image: bytes) -> List[Position]:
pass
```

### モザイクをつける

一つのスタイル/パターンで、一つのクラスで実装する
Expand All @@ -134,45 +141,29 @@ flask run
- 使うもの
- OpenCV

## クラスデザイン

### 写真

```py
class Image():

def __init__(self, image_data):
self.data = image_data
self.processed_data = None

def get_size(self):
pass
#### クラスデザイン

```

### モザイクパターンクラス
![-](README/filter-class.svg)

```py
class MosaicPattern():
class AbstractMosaicFilter(abc.ABC):

def __init__(self, pattern, style):
self.pattern = pattern
self.style = style
```
# フロントエンドのほうのモザイクパターンの名前
name = None

### モザイクフィルタークラス
@abc.abstractmethod
def process(self, image: Image, style: AbstructMosaicStyle, positions: List[Position]) -> bytes:
'''写真を処理し、モザイクをつけた写真を返す
![-](README/filter-class.svg)
Args:
image (bytes): アップロードした写真
style (Any): モザイクのスタイル
positions (List[Position]): 顔認識の位置
```py
class AbstractMosaicFilter(abc.ABC):

@abc.abstractmethod
def process(self, image) :
'''
写真を処理する
'''
pass
Returns:
bytes: モザイクをつけた写真
'''
pass

class EyesLineMosaicFilter(AbstractMosaicFilter):
"""
Expand Down

0 comments on commit ad5f038

Please sign in to comment.