From 0d97e9b2d738682ed0aa6349b43a9719e0ca0aa9 Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Sat, 17 Nov 2018 18:55:57 +0000
Subject: [PATCH] Created package and setup.py.

---
 aoiOcr.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/aoiOcr.py b/aoiOcr.py
index 9188b0a..be3f863 100644
--- a/aoiOcr.py
+++ b/aoiOcr.py
@@ -1,10 +1,13 @@
-from Ocr import Paper
+from aoi_ocr.Ocr import Paper
 from sklearn.externals import joblib
+import pkg_resources
+path = '/filename.joblib'  # always use slash
+filepath = pkg_resources.resource_filename('aoi_ocr', path)
 
 from glob import glob
 
 settings = {"sid_mask": "64xx0xxx", "answer_threshold": 0.25}
-classifier = joblib.load("filename.joblib")
+classifier = joblib.load(filepath)
 
 #p = Paper(filename="testpage300dpi_scan1.png")
 #p=Paper(filename='sizif111.tif', sid_classifier=classifier, settings={"sid_mask": "11xx0xxx", "answer_threshold": 0.25})

--
Gitblit v1.9.3