Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- fa
|
| 4 |
+
- en
|
| 5 |
+
library_name: hezar
|
| 6 |
+
pipeline_tag: object-detection
|
| 7 |
+
tags:
|
| 8 |
+
- hezar
|
| 9 |
+
---
|
| 10 |
+
## CRAFT: Character-Region Awareness For Text detection
|
| 11 |
+
|
| 12 |
+
CRAFT is a multilingual text detection model. The original implementation is located at https://github.com/clovaai/CRAFT-pytorch. This repo is only compatible
|
| 13 |
+
with the [Hezar](https://github.com/hezarai/hezar) package.
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
### Usage
|
| 17 |
+
```
|
| 18 |
+
pip install hezar[vision]
|
| 19 |
+
```
|
| 20 |
+
```python
|
| 21 |
+
import cv2
|
| 22 |
+
from hezar.models import Model
|
| 23 |
+
from hezar.utils import draw_boxes
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
model = Model.load("craft", device="cuda")
|
| 27 |
+
outputs = model.predict("../assets/sample.png")
|
| 28 |
+
image = cv2.imread("../assets/O1.png")
|
| 29 |
+
result_image = draw_boxes(image, outputs[0]["boxes"])
|
| 30 |
+
cv2.imwrite("detected.png", result_image)
|
| 31 |
+
```
|