diff --git a/examples/modelscope/captcha.php b/examples/modelscope/captcha.php new file mode 100644 index 0000000..f938188 --- /dev/null +++ b/examples/modelscope/captcha.php @@ -0,0 +1,11 @@ +pipeline; +$Tasks = PyCore::import('modelscope.utils.constant')->Tasks; +// 模型可以换成 xiaolv/ocr_small +$pipe = $pipeline($Tasks->ocr_recognition, model: 'damo/cv_convnextTiny_ocr-recognition-general_damo'); +$file = '/tmp/captcha.png'; +file_put_contents($file, file_get_contents('https://business.swoole.com/page/captcha_register')); +echo '识别结果:' . $pipe($file)['text'][0], PHP_EOL; diff --git a/make.sh b/make.sh index abab022..9718c5f 100755 --- a/make.sh +++ b/make.sh @@ -1,3 +1,4 @@ phpize ./configure +make clean make -j install