Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mahindra_ocr_shikhin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikhin.vc
mahindra_ocr_shikhin
Commits
be120938
Commit
be120938
authored
Dec 05, 2022
by
Sikhin VC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix 2
parent
7ab18e7b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
app.py
app.py
+3
-1
scripts/cement_counter.py
scripts/cement_counter.py
+10
-2
No files found.
app.py
View file @
be120938
...
...
@@ -10,8 +10,10 @@ from datetime import datetime
ROOT_DIR
=
os
.
path
.
abspath
(
os
.
curdir
)
# ACCCameratesting_f5a780d8
os
.
environ
[
"config"
]
=
"{
\"
TZ
\"
:
\"
Asia/Kolkata
\"
,
\"
MONGO_URI
\"
:
\"
mongodb://192.168.0.220:2717/admin
\"
,
\"
MONGO_DATABASE
\"
:
\"
ilens_ai
\"
,
\"
MONGO_COLLECTION
\"
:
\"
janusDeployment
\"
,
\"
MONGO_KEY
\"
:
\"
deploymentId
\"
,
\"
MONGO_VALUE
\"
:
\"
ACCCementCamera20_61275102
\"
,
\"
MONGO_COLL
\"
:
\"
serviceConfiguration
\"
,
\"
MONGO_DB
\"
:
\"
ilens_ai
\"
}"
# os.environ["config"]="{\"TZ\": \"Asia/Kolkata\", \"MONGO_URI\": \"mongodb://192.168.0.220:2717/admin\", \"MONGO_DATABASE\": \"ilens_ai\", \"MONGO_COLLECTION\": \"janusDeployment\", \"MONGO_KEY\": \"deploymentId\", \"MONGO_VALUE\": \"ACCCementCamera20_61275102\", \"MONGO_COLL\": \"serviceConfiguration\", \"MONGO_DB\": \"ilens_ai\"}"
os
.
environ
[
"config"
]
=
"{
\"
TZ
\"
:
\"
Asia/Kolkata
\"
,
\"
MONGO_URI
\"
:
\"
mongodb://admin:iLens$1234@192.168.3.181:2717/admin
\"
,
\"
MONGO_DATABASE
\"
:
\"
ilens_ai
\"
,
\"
MONGO_COLLECTION
\"
:
\"
janusDeployment
\"
,
\"
MONGO_KEY
\"
:
\"
deploymentId
\"
,
\"
MONGO_VALUE
\"
:
\"
ACCCameratesting_f5a780d8
\"
,
\"
MONGO_COLL
\"
:
\"
serviceConfiguration
\"
,
\"
MONGO_DB
\"
:
\"
ilens_ai
\"
}"
from
edge_engine.edge_processor
import
ExecutePipeline
from
edge_engine.edge_processor
import
Pubs
from
scripts
import
CementBagCounter
...
...
scripts/cement_counter.py
View file @
be120938
...
...
@@ -89,6 +89,7 @@ class CementBagCounter(ModelWrapper):
self
.
internal_engine
=
[
"2"
,
"K"
,
"G"
,
"A"
]
self
.
internal
=
[
"T"
,
"F"
,
"A"
,
"E"
,
"X"
,
"A"
]
self
.
internal_front_axle_bar_2
=
[
"A"
,
"B"
,
"A"
,
"C"
,
"A"
,
"A"
]
self
.
internal_front_axle_bar_2_2
=
[
"A"
,
"B"
,
"A"
,
"E"
,
"X"
,
"K"
]
self
.
internal_front_axle_bar
=
[
"T"
,
"F"
,
"A"
,
"E"
,
"X"
,
"A"
]
# self.fixed_and_internal_front_axle_bar_2 = ["M", "B", "N", "A", "B", "A", "C", "A", "A"]
self
.
fixed_and_internal_engine
=
[
"2"
,
"K"
,
"C"
,
"A"
]
...
...
@@ -196,7 +197,7 @@ class CementBagCounter(ModelWrapper):
def
check_character
(
self
,
character
):
if
len
(
character
)
==
17
:
return
"front_axle_bar"
elif
len
(
character
)
==
1
3
:
elif
len
(
character
)
==
1
1
:
return
"engine"
else
:
...
...
@@ -221,17 +222,22 @@ class CementBagCounter(ModelWrapper):
# print(sub_list)
matching_chars
=
[
i
for
i
,
j
in
zip
(
sub_list
,
self
.
internal_front_axle_bar
)
if
i
==
j
]
matching_chars_2
=
[
i
for
i
,
j
in
zip
(
sub_list
,
self
.
internal_front_axle_bar_2
)
if
i
==
j
]
matching_chars_2_2
=
[
i
for
i
,
j
in
zip
(
sub_list
,
self
.
internal_front_axle_bar_2_2
)
if
i
==
j
]
# print(matching_chars)
if
(
len
(
matching_chars
)
>
3
):
return
True
,
"front axle_bar"
if
(
len
(
matching_chars_2
)
>
3
):
return
True
,
"front axle bar 2"
if
(
len
(
matching_chars_2_2
)
>
3
):
return
True
,
"front axle bar 2"
return
False
,
None
else
:
sub_list
=
text_list
[
3
:
7
]
# print(sub_list)
matching_chars
=
[
i
for
i
,
j
in
zip
(
sub_list
,
self
.
internal_engine
)
if
i
==
j
]
# print(matching_chars)
print
(
matching_chars
)
print
(
"entered to internal char check----------------"
)
if
(
len
(
matching_chars
)
>
0
):
# print("1234567890!@#$%^&*()")
return
True
,
None
...
...
@@ -386,6 +392,8 @@ class CementBagCounter(ModelWrapper):
text
=
self
.
paddle_ocr_predict
(
self
.
ocr
,
frame
)
print
(
"detected text is ---------------"
,
text
)
part_name
=
self
.
check_character
(
text
)
print
(
"part name is "
,
part_name
)
if
not
part_name
:
text
=
"Image not Clear"
self
.
text_json
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment