Skip to content

Commit 572d664

Browse files
authored
Merge pull request #175 from javaTheHutts/Develop
Stable Version
2 parents 6b81b53 + a625827 commit 572d664

File tree

95 files changed

+4341
-1643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+4341
-1643
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ install:
2121
- pip3.5 install zbar-py==1.0.4
2222
- pyb install_dependencies
2323
# command to build project
24-
script: pyb analyze publish
24+
script: pyb analyze full publish install

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,24 @@ Once you are finished, execute the command `deactivate` in order to exit your vi
7575
## Important files
7676
- `build.py` contains the configuration used by PyBuilder to build the project. Any plugins and customized build settings are contained in this file.
7777
- `README.md`. This file explains how the entire system should be built and used. Refer to it before asking any questions about the build process.
78+
79+
## Examples:
80+
# Extraction of a South African ID card.
81+
82+
Hutts Verification allows for easy extraction of identification details from either a South African ID book or card.
83+
84+
When a South African Identification document is provided to Hutts Verification a profile picture with all the necessary text is extracted from the card provided.
85+
86+
![alt text](documentation/media/ExtractAll.gif "Extract All Example ID Card")
87+
88+
# Verify Details.
89+
90+
Hutts Verification focuses on two main verification attributes:
91+
1. Verify face details.
92+
2. Verify text details.
93+
94+
When details are being verified a South African ID book or card should be sent to Hutts Verification. Additionally, a clear and well-lit photo of the individual that should be verified must be provided, with the additional text details that must be verified with that of the card.
95+
96+
After Hutts Verification has finished verification, three scores representing the text verification score, face verification score, and the overall weighted score is returned.
97+
98+
![alt text](documentation/media/Verify.gif "Verify Details")

build.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
@init
1717
def init(project):
1818
project.plugin_depends_on("flake8", "~=3.2")
19+
project.depends_on_requirements("requirements.txt")
1920

2021
# directory with pytest modules
2122
project.set_property("dir_source_pytest_python", "src/unittest/python")
@@ -46,6 +47,19 @@ def assert_flake8_is_executable(logger):
4647
prerequisite="flake8",
4748
caller="plugin python.flake8")
4849

50+
@task("full", description="Includes all of the data files in the installation process.")
51+
@after("prepare")
52+
def full_setup(project, logger):
53+
# include the training data in the correct package
54+
logger.info("Including the data files in the installation...")
55+
img_pre_trained_data_path = "lib/python3.5/site-packages/image_preprocessing/trained_data/"
56+
img_pre_templates_path = "lib/python3.5/site-packages/image_preprocessing/templates/"
57+
project.install_file(img_pre_trained_data_path, "image_preprocessing/trained_data/dlib_face_recognition_resnet_model_v1.dat")
58+
project.install_file(img_pre_trained_data_path, "image_preprocessing/trained_data/shape_predictor_face_landmarks.dat")
59+
project.install_file(img_pre_templates_path, "image_preprocessing/templates/pp2.jpg")
60+
project.install_file(img_pre_templates_path, "image_preprocessing/templates/temp_flag.jpg")
61+
project.install_file(img_pre_templates_path, "image_preprocessing/templates/wap.jpg")
62+
4963
@task
5064
@depends("prepare")
5165
def analyze(project, logger):

demo/css/style.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,27 @@ button.picker__close {
632632
text-align: center;
633633
}
634634

635+
/* Loader overlay */
636+
.loader-overlay {
637+
background: none repeat scroll 0 0 black;
638+
position: fixed;
639+
display: block;
640+
opacity: 0.7;
641+
z-index: 1000001;
642+
left: 0;
643+
top: 0;
644+
height: 100%;
645+
width: 100%;
646+
}
647+
648+
.loader-overlay .spinner {
649+
padding: 0;
650+
}
651+
652+
.loader-overlay .spinner div p {
653+
color: white;
654+
}
655+
635656
/*Footer styling */
636657
.page-footer,
637658
.page-footer .footer-copyright {

demo/index.html

Lines changed: 72 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<script type="text/javascript" src="js/lightbox.js"></script>
2222
<script type="text/javascript" src="js/sticky-nav.js"></script>
2323
<script type="text/javascript" src="js/script.js"></script>
24+
<script src="js/jquery.circliful.min.js"></script>
2425
</head>
2526

2627
<body>
@@ -86,23 +87,36 @@
8687
</div>
8788
<div class="collapsible-body">
8889
<div class="row">
90+
<div class="col s12">
91+
<div class="col s6">
92+
<p><b>Auto Settings</b></p>
93+
</div>
94+
<div class="col s6">
95+
<div class="switch">
96+
<label>
97+
Off
98+
<input type="checkbox" id="auto_settings" checked="checked">
99+
<span class="lever"></span>
100+
On
101+
</label>
102+
</div>
103+
</div>
104+
</div>
89105
<div class="col s6">
90106
<p class="special">Techniques</p>
91107
</div>
92108
<div class="input-field col s12">
93-
<select>
94-
<option value="" disabled selected></option>
95-
<option value="1">Conventional</option>
96-
<option value="2">Gaussian</option>
97-
<option value="3">Median</option>
109+
<select id="blur_technique" disabled class="text-extract-settings">
110+
<option value="normal">Conventional</option>
111+
<option value="gaussian">Gaussian</option>
112+
<option value="median" selected="selected">Median</option>
98113
</select>
99114
<label>Blur Technique</label>
100115
</div>
101116
<div class="input-field col s12">
102-
<select>
103-
<option value="" disabled selected></option>
104-
<option value="1">Adaptive</option>
105-
<option value="2">Otsu</option>
117+
<select id="threshold_technique" disabled class="text-extract-settings">
118+
<option value="adaptive" selected="selected">Adaptive</option>
119+
<option value="otsu">Otsu</option>
106120
</select>
107121
<label>Threshold Technique</label>
108122
</div>
@@ -117,7 +131,7 @@
117131
<div class="switch">
118132
<label>
119133
No
120-
<input type="checkbox" checked="checked">
134+
<input type="checkbox" id="profile_switch" disabled class="text-switch text-extract-settings">
121135
<span class="lever"></span>
122136
Yes
123137
</label>
@@ -133,7 +147,7 @@
133147
<div class="switch">
134148
<label>
135149
No
136-
<input type="checkbox" checked="checked">
150+
<input type="checkbox" id="barcode_switch" disabled class="text-switch text-extract-settings">
137151
<span class="lever"></span>
138152
Yes
139153
</label>
@@ -150,7 +164,7 @@
150164
<div class="switch">
151165
<label>
152166
No
153-
<input type="checkbox">
167+
<input type="checkbox" disabled id="extract_red" class="text-switch channel_extractors text-extract-settings">
154168
<span class="lever"></span>
155169
Yes
156170
</label>
@@ -163,7 +177,7 @@
163177
<div class="switch">
164178
<label>
165179
No
166-
<input type="checkbox">
180+
<input type="checkbox" id="extract_green" class="text-switch channel_extractors text-extract-settings" disabled>
167181
<span class="lever"></span>
168182
Yes
169183
</label>
@@ -176,7 +190,7 @@
176190
<div class="switch">
177191
<label>
178192
No
179-
<input type="checkbox">
193+
<input type="checkbox" id="extract_blue" class="text-switch channel_extractors text-extract-settings" disabled>
180194
<span class="lever"></span>
181195
Yes
182196
</label>
@@ -300,6 +314,16 @@
300314
<input class="file-path validate" type="text">
301315
</div>
302316
</div>
317+
<div class="col s12 l6 offset-l6 input-field">
318+
<i class=" material-icons prefix fa fa-id-badge" aria-hidden="true"></i>
319+
<select id="id-type-extract">
320+
<option value="default" selected>DEFAULT</option>
321+
<option value="idbook">ID BOOK</option>
322+
<option value="idcard">ID CARD</option>
323+
<option value="studentcard">STUDENT CARD</option>
324+
</select>
325+
<label for="id-type-extract">Identification Type</label>
326+
</div>
303327
</div>
304328
</div>
305329
</div>
@@ -518,6 +542,16 @@
518542
</div>
519543
</div>
520544
</div>
545+
<div class="col s12 l6 offset-l6 input-field">
546+
<i class=" material-icons prefix fa fa-id-badge" aria-hidden="true"></i>
547+
<select id="id-type-verify">
548+
<option value="default" selected>DEFAULT</option>
549+
<option value="idbook">ID BOOK</option>
550+
<option value="idcard">ID CARD</option>
551+
<option value="studentcard">STUDENT CARD</option>
552+
</select>
553+
<label for="id-type-verify">Identification Type</label>
554+
</div>
521555
</div>
522556
</div>
523557
</div>
@@ -541,7 +575,7 @@
541575
<div class="card">
542576
<div class="card-content">
543577
<div class="pipe-gallery">
544-
<div class="pipeline">
578+
<div id="text-pipe" class="pipeline">
545579
<!-- Example -->
546580
<!--<a href="img/output/cannay.png" data-lightbox="pipelet-slide">-->
547581
<!--<div class="pipe-slide"
@@ -571,7 +605,7 @@
571605
<div class="card">
572606
<div class="card-content">
573607
<div class="pipe-gallery">
574-
<div class="pipeline">
608+
<div id="profile-pipe" class="pipeline">
575609
</div>
576610
</div>
577611
</div>
@@ -747,9 +781,30 @@
747781
</div>
748782
</div>
749783
<!-- End result modal -->
750-
751784
</ul>
752785
</div>
786+
787+
<!-- Loader overlay -->
788+
<div class="loader-overlay" style="display: none">
789+
<div class="row center-align spinner">
790+
<div class="preloader-wrapper big active">
791+
<div class="spinner-layer spinner-teal-only">
792+
<div class="circle-clipper left">
793+
<div class="circle"></div>
794+
</div><div class="gap-patch">
795+
<div class="circle"></div>
796+
</div><div class="circle-clipper right">
797+
<div class="circle"></div>
798+
</div>
799+
</div>
800+
</div>
801+
<div>
802+
<p>Extracting...</p>
803+
</div>
804+
</div>
805+
</div>
806+
<!-- End Loader overlay -->
807+
753808
</main>
754809

755810
<footer class="page-footer">

0 commit comments

Comments
 (0)