Downloads · 30 days
738
0% of all-time downloads
hezarai/CRAFT
CRAFT is a object detection model from hezarai. Use it when you need objects located in an image. It is set up for hezar.
CRAFT is a multilingual text detection model. The original implementation is located at https://github.com/clovaai/CRAFT-pytorch. This repo is only compatible with the Hezar package (=v0.40.0) to perform text detectio…
Downloads · 30 days
738
0% of all-time downloads
All-time downloads
348K
Public
Repo size
83.2 MB
Likes
11
Public
Click a slice to open those files.
.pt83.2 MB · 100%
From the Hugging Face model README
CRAFT is a multilingual text detection model. The original implementation is located at https://github.com/clovaai/CRAFT-pytorch. This repo is only compatible with the Hezar package (>=v0.40.0) to perform text detection for Persian but other languages should work too.
pip install hezar[vision]
from hezar.models import Model
from hezar.utils import load_image, draw_boxes, show_image
model = Model.load("hezarai/CRAFT", device="cuda")
image = load_image("../assets/text_detection_example.jpg")
outputs = model.predict(image)
result_image = draw_boxes(image, outputs[0]["boxes"])
show_image(result_image, "text_detected")