Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
Welspun-Classification
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
dasharatha.vamshi
Welspun-Classification
Commits
acc56d1a
Commit
acc56d1a
authored
Feb 12, 2021
by
dasharatha.vamshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code
parent
e1cb9202
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
16 deletions
+28
-16
scripts/welspun_classifier.py
scripts/welspun_classifier.py
+28
-16
No files found.
scripts/welspun_classifier.py
View file @
acc56d1a
...
...
@@ -238,7 +238,7 @@ class Welspun_Classifier(ModelWrapper):
"sound_1"
)
logger
.
info
(
f
"Probability: {prob}"
)
self
.
counter
=
0
elif
a
==
1
and
max
(
x
)
>
0.95
:
elif
a
==
2
and
max
(
x
)
>
0.95
:
resized_frame
=
cv2
.
resize
(
frame
,
(
64
,
64
))
cv2
.
putText
(
frame
,
text
=
"Split Defect Detected"
,
org
=
(
50
,
50
),
color
=
(
0
,
0
,
255
),
...
...
@@ -250,21 +250,33 @@ class Welspun_Classifier(ModelWrapper):
"sound_1"
)
logger
.
info
(
f
"Probability: {prob}"
)
self
.
counter
=
0
else
:
logger
.
info
(
"enter else loop"
)
if
sum
(
sum
(
sum
(
frame
)))
==
0
:
pass
else
:
resized_frame
=
cv2
.
resize
(
frame
,
(
64
,
64
))
cv2
.
putText
(
frame
,
text
=
"No Defect"
,
org
=
(
50
,
50
),
color
=
(
0
,
0
,
255
),
thickness
=
2
,
fontScale
=
1
,
fontFace
=
cv2
.
LINE_AA
)
if
self
.
counter
%
25
==
0
:
self
.
send_payload
(
"No Defect"
,
resized_frame
,
"No Defect "
,
"#044b04"
,
"#24dc24"
,
"sound_1"
)
logger
.
info
(
f
"Probability: {prob}"
)
self
.
counter
=
0
elif
a
==
1
and
max
(
x
)
>
0.95
:
resized_frame
=
cv2
.
resize
(
frame
,
(
64
,
64
))
cv2
.
putText
(
frame
,
text
=
"Short Tile Defect Detected"
,
org
=
(
50
,
50
),
color
=
(
0
,
0
,
255
),
thickness
=
2
,
fontScale
=
1
,
fontFace
=
cv2
.
LINE_AA
)
if
self
.
counter
%
25
==
0
:
self
.
send_payload
(
"Short Tile Detected"
,
resized_frame
,
"Short Tile "
+
str
(
prob
[
1
]),
"#472020"
,
"#ed2020"
,
"sound_1"
)
logger
.
info
(
f
"Probability: {prob}"
)
self
.
counter
=
0
# else:
# logger.info("enter else loop")
# if sum(sum(sum(frame))) == 0:
# pass
# else:
# resized_frame = cv2.resize(frame, (64, 64))
# cv2.putText(frame, text="No Defect", org=(50, 50),
# color=(0, 0, 255),
# thickness=2,
# fontScale=1, fontFace=cv2.LINE_AA)
#
# if self.counter % 25 == 0:
# self.send_payload("No Defect", resized_frame, "No Defect ", "#044b04", "#24dc24", "sound_1")
# logger.info(f"Probability: {prob}")
# self.counter = 0
# if prob[0] > 0.9:
# # print("prob--->",prob[0])
# cv2.putText(frame, text="Stitch Detected with Probability :" + str(prob[0]), org=(50, 50),
...
...
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