Commit 7222f5d6 authored by Sikhin VC's avatar Sikhin VC

fixed bugs

parent ce8aed7c
Pipeline #49805 canceled with stage
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment