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
7222f5d6
Commit
7222f5d6
authored
Dec 05, 2022
by
Sikhin VC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bugs
parent
ce8aed7c
Pipeline
#49805
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
scripts/cement_counter.py
scripts/cement_counter.py
+24
-5
No files found.
scripts/cement_counter.py
View file @
7222f5d6
...
...
@@ -91,6 +91,7 @@ class CementBagCounter(ModelWrapper):
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
.
internal_front_axle_bar_next
=
[
"T"
,
"F"
,
"A"
,
"J"
,
"B"
,
"E"
]
# 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"
]
self
.
month_engine
=
[
"K"
,
"L"
,
"M"
,
"A"
,
"B"
,
"C"
,
"D"
,
"E"
,
"F"
,
"G"
,
"H"
,
"J"
]
...
...
@@ -221,9 +222,12 @@ class CementBagCounter(ModelWrapper):
sub_list
=
text_list
[
3
:
9
]
# print(sub_list)
matching_chars
=
[
i
for
i
,
j
in
zip
(
sub_list
,
self
.
internal_front_axle_bar
)
if
i
==
j
]
matching_chars_next
=
[
i
for
i
,
j
in
zip
(
sub_list
,
self
.
internal_front_axle_bar_next
)
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_next
)
>
3
):
return
True
,
"front axle_bar"
if
(
len
(
matching_chars
)
>
3
):
return
True
,
"front axle_bar"
if
(
len
(
matching_chars_2
)
>
3
):
...
...
@@ -332,14 +336,15 @@ class CementBagCounter(ModelWrapper):
actual_text
.
append
(
text_list
[
9
])
else
:
return
"Image not clear"
,
False
if
(
month
_verification
):
actual_text
.
append
(
text_list
[
11
]
)
if
(
plant
_verification
):
actual_text
.
append
(
"R"
)
else
:
return
"Image not clear"
,
False
if
(
plant
_verification
):
actual_text
.
append
(
"R"
)
if
(
month
_verification
):
actual_text
.
append
(
text_list
[
11
]
)
else
:
return
"Image not clear"
,
False
for
elem
in
corrected_digit
:
print
(
"elements are----"
)
print
(
elem
)
...
...
@@ -407,11 +412,25 @@ class CementBagCounter(ModelWrapper):
text_list
.
append
(
letter
)
# print(text_list)
fixed_verification
=
self
.
fixed_char_check
(
text_list
,
part_name
)
if
not
fixed_verification
:
text
=
"Image not Clear"
self
.
text_json
=
{
"data"
:
{
"text"
:
" "
,
"fixed characters"
:
" "
,
"internal characters"
:
" "
,
"year"
:
" "
,
"month"
:
" "
,
"plant"
:
" "
,
"serial number"
:
" "
},
"status"
:
False
,
"message"
:
"Image not clear"
}
pass
internal_verification
,
chassis_part
=
self
.
internal_char_check
(
text_list
,
part_name
)
if
not
internal_verification
:
text
=
"Image not Clear"
self
.
text_json
=
{
"data"
:
{
"text"
:
" "
,
"fixed characters"
:
" "
,
"internal characters"
:
" "
,
"year"
:
" "
,
"month"
:
" "
,
"plant"
:
" "
,
"serial number"
:
" "
},
"status"
:
False
,
"message"
:
"Image not clear"
}
pass
# if char_verification1:
# self.recognition_output_list.extend(self.fixed_and_internal_trackter)
# else:
# text = "Image not Clear"
# text = "Image not Clear"
+
# if(plant_verification):
plant_verification
=
self
.
plant_ver
(
text_list
,
part_name
)
...
...
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