Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dygraph' into dygraph
Browse files Browse the repository at this point in the history
  • Loading branch information
Evezerest committed Aug 8, 2021
2 parents dcaf35d + 9236f33 commit 2aa52a0
Show file tree
Hide file tree
Showing 40 changed files with 1,684 additions and 1,422 deletions.
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ recursive-include ppocr/utils *.txt utility.py logging.py network.py
recursive-include ppocr/data *.py
recursive-include ppocr/postprocess *.py
recursive-include tools/infer *.py
recursive-include ppocr/utils/e2e_utils *.py
recursive-include ppocr/utils/e2e_utils *.py
recursive-include ppstructure *.py
7 changes: 4 additions & 3 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import paddleocr
from .paddleocr import *

__all__ = ['PaddleOCR', 'draw_ocr']
from .paddleocr import PaddleOCR
from .tools.infer.utility import draw_ocr
__version__ = paddleocr.VERSION
__all__ = ['PaddleOCR', 'PPStructure', 'draw_ocr', 'draw_structure_result', 'save_structure_res','download_with_progressbar']
10 changes: 5 additions & 5 deletions configs/rec/rec_icdar15_train.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Global:
cal_metric_during_train: True
pretrained_model:
checkpoints:
save_inference_dir:
save_inference_dir: ./
use_visualdl: False
infer_img: doc/imgs_words_en/word_10.png
# for data or label process
Expand Down Expand Up @@ -60,8 +60,8 @@ Metric:
Train:
dataset:
name: SimpleDataSet
data_dir: ./train_data/
label_file_list: ["./train_data/train_list.txt"]
data_dir: ./train_data/ic15_data/
label_file_list: ["./train_data/ic15_data/rec_gt_train.txt"]
transforms:
- DecodeImage: # load image
img_mode: BGR
Expand All @@ -81,8 +81,8 @@ Train:
Eval:
dataset:
name: SimpleDataSet
data_dir: ./train_data/
label_file_list: ["./train_data/val_list.txt"]
data_dir: ./train_data/ic15_data
label_file_list: ["./train_data/ic15_data/rec_gt_test.txt"]
transforms:
- DecodeImage: # load image
img_mode: BGR
Expand Down
2 changes: 0 additions & 2 deletions deploy/cpp_infer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ endif()


if (WIN32)
include_directories("${PADDLE_LIB}/paddle/fluid/inference")
include_directories("${PADDLE_LIB}/paddle/include")
link_directories("${PADDLE_LIB}/paddle/lib")
link_directories("${PADDLE_LIB}/paddle/fluid/inference")
find_package(OpenCV REQUIRED PATHS ${OPENCV_DIR}/build/ NO_DEFAULT_PATH)

else ()
Expand Down
2 changes: 1 addition & 1 deletion deploy/cpp_infer/docs/windows_vs2019_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PaddleOCR在Windows 平台下基于`Visual Studio 2019 Community` 进行了测

### Step1: 下载PaddlePaddle C++ 预测库 fluid_inference

PaddlePaddle C++ 预测库针对不同的`CPU``CUDA`版本提供了不同的预编译版本,请根据实际情况下载: [C++预测库下载列表](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/05_inference_deployment/inference/windows_cpp_inference.html)
PaddlePaddle C++ 预测库针对不同的`CPU``CUDA`版本提供了不同的预编译版本,请根据实际情况下载: [C++预测库下载列表](https://paddleinference.paddlepaddle.org.cn/user_guides/download_lib.html#windows)

解压后`D:\projects\fluid_inference`目录包含内容为:
```
Expand Down
10 changes: 8 additions & 2 deletions deploy/cpp_infer/src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ std::vector<std::string> OCRConfig::split(const std::string &str,
std::vector<std::string> res;
if ("" == str)
return res;
char strs[str.length() + 1];

int strlen = str.length() + 1;
chars *strs = new char[strlen];
std::strcpy(strs, str.c_str());

char d[delim.length() + 1];
int delimlen = delim.length() + 1;
char *d = new char[delimlen];
std::strcpy(d, delim.c_str());

delete[] strs;
delete[] d;

char *p = std::strtok(strs, d);
while (p) {
std::string s = p;
Expand Down
Loading

0 comments on commit 2aa52a0

Please sign in to comment.