From bb0a226a9731ef7f2d5dc377ee933a316bd6bdbe Mon Sep 17 00:00:00 2001 From: MRXLT Date: Fri, 29 May 2020 08:22:52 +0000 Subject: [PATCH] add ocr rec demo --- python/examples/ocr/README.md | 21 +++++++++++++++++++ .../paddle_serving_app/models/model_list.py | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 python/examples/ocr/README.md diff --git a/python/examples/ocr/README.md b/python/examples/ocr/README.md new file mode 100644 index 00000000..04c4fd3e --- /dev/null +++ b/python/examples/ocr/README.md @@ -0,0 +1,21 @@ +# OCR + +## Get Model +``` +python -m paddle_serving_app.package --get_model ocr_rec +tar -xzvf ocr_rec.tar.gz +``` + +## RPC Service + +### Start Service + +``` +python -m paddle_serving_server.serve --model ocr_rec_model --port 9292 +``` + +### Client Prediction + +``` +python test_ocr_rec_client.py +``` diff --git a/python/paddle_serving_app/models/model_list.py b/python/paddle_serving_app/models/model_list.py index 3d08f2fe..fa048352 100644 --- a/python/paddle_serving_app/models/model_list.py +++ b/python/paddle_serving_app/models/model_list.py @@ -31,10 +31,12 @@ class ServingModels(object): self.model_dict["ImageClassification"] = [ "resnet_v2_50_imagenet", "mobilenet_v2_imagenet" ] + self.model_dict["OCR"] = ["ocr_rec"] image_class_url = "https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/ImageClassification/" image_seg_url = "https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/ImageSegmentation/" object_detection_url = "https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/ObjectDetection/" + ocr_url = "https://paddle-serving.bj.bcebos.com/paddle_hub_models/image/OCR/" senta_url = "https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/SentimentAnalysis/" semantic_url = "https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/SemanticRepresentation/" wordseg_url = "https://paddle-serving.bj.bcebos.com/paddle_hub_models/text/LexicalAnalysis/" @@ -52,6 +54,7 @@ class ServingModels(object): pack_url(self.model_dict, "ObjectDetection", object_detection_url) pack_url(self.model_dict, "ImageSegmentation", image_seg_url) pack_url(self.model_dict, "ImageClassification", image_class_url) + pack_url(self.model_dict, "OCR", ocr_url) def get_model_list(self): return self.model_dict -- GitLab