This repository was archived by the owner on Dec 2, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,14 @@ pip install craft-text-detector
3636from craft_text_detector import Craft
3737
3838# set image path and export folder directory
39- image_path = ' figures/idcard.png'
39+ image = ' figures/idcard.png' # can be filepath, PIL image or numpy array
4040output_dir = ' outputs/'
4141
4242# create a craft instance
4343craft = Craft(output_dir = output_dir, crop_type = " poly" , cuda = False )
4444
4545# apply craft text detection and export detected regions to output directory
46- prediction_result = craft.detect_text(image_path )
46+ prediction_result = craft.detect_text(image )
4747
4848# unload models from ram/gpu
4949craft.unload_craftnet_model()
@@ -65,11 +65,11 @@ from craft_text_detector import (
6565)
6666
6767# set image path and export folder directory
68- image_path = ' figures/idcard.png'
68+ image = ' figures/idcard.png' # can be filepath, PIL image or numpy array
6969output_dir = ' outputs/'
7070
7171# read image
72- image = read_image(image_path )
72+ image = read_image(image )
7373
7474# load models
7575refine_net = load_refinenet_model(cuda = True )
You can’t perform that action at this time.
0 commit comments