|
@@ -2,7 +2,7 @@
|
|
|
|
|
|
An unofficial PyTorch implementation of CRAFT text detector with better interface and fp16 support
|
|
An unofficial PyTorch implementation of CRAFT text detector with better interface and fp16 support
|
|
|
|
|
|
-> This is not an official implementation. I partially use code from the [original repository](https://github.com/clovaai/CRAFT-pytorch)
|
|
|
|
|
|
+> This is not official implementation. I partially use code from the [original repository](https://github.com/clovaai/CRAFT-pytorch)
|
|
|
|
|
|
Main features of this implementation:
|
|
Main features of this implementation:
|
|
- User-friendly interface
|
|
- User-friendly interface
|
|
@@ -18,11 +18,21 @@ cd CRAFT-text-detection/
|
|
pip install -r requirements.txt
|
|
pip install -r requirements.txt
|
|
```
|
|
```
|
|
|
|
|
|
-To test the model you can run `test.py` file.
|
|
|
|
|
|
+To test model you can run `test.py` file.
|
|
|
|
|
|
## Examples
|
|
## Examples
|
|
|
|
|
|
-You can find usage examples in [example.ipynb](example.ipynb)
|
|
|
|
|
|
+```python
|
|
|
|
+from PIL import Image
|
|
|
|
+from CRAFT import CRAFTModel, draw_polygons
|
|
|
|
+
|
|
|
|
+model = CRAFTModel('weights/', 'cuda', use_refiner=True, fp16=True)
|
|
|
|
+img = Image.open('images/cafe_sign.jpg')
|
|
|
|
+polygons = model.get_polygons(img)
|
|
|
|
+result = draw_polygons(img, polygons)
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+You can find more usage examples in [example.ipynb](example.ipynb)
|
|
|
|
|
|

|
|

|
|
|
|
|