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
525d15c1
Commit
525d15c1
authored
Feb 15, 2021
by
dasharatha.vamshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes
parent
1dcd5d75
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4761 additions
and
4 deletions
+4761
-4
scripts/model/resnet34-demo.bin
scripts/model/resnet34-demo.bin
+0
-0
scripts/model/resnet34-demo.mapping
scripts/model/resnet34-demo.mapping
+543
-0
scripts/model/resnet34-demo.xml
scripts/model/resnet34-demo.xml
+4191
-0
scripts/welspun_classifier.py
scripts/welspun_classifier.py
+27
-4
No files found.
scripts/model/resnet34-demo.bin
0 → 100644
View file @
525d15c1
File added
scripts/model/resnet34-demo.mapping
0 → 100644
View file @
525d15c1
This diff is collapsed.
Click to expand it.
scripts/model/resnet34-demo.xml
0 → 100644
View file @
525d15c1
This source diff could not be displayed because it is too large. You can
view the blob
instead.
scripts/welspun_classifier.py
View file @
525d15c1
...
...
@@ -43,7 +43,7 @@ class Welspun_Classifier(ModelWrapper):
# open-vino
self
.
sink_layer
=
{
'0'
:
'conv2d_58/BiasAdd/Add'
,
'1'
:
'conv2d_66/BiasAdd/Add'
,
'2'
:
'conv2d_74/BiasAdd/Add'
}
self
.
model_detector_pth
=
os
.
path
.
join
(
self
.
base_model_path
,
"resnet34-
wel4
.xml"
)
self
.
model_detector_pth
=
os
.
path
.
join
(
self
.
base_model_path
,
"resnet34-
demo
.xml"
)
self
.
model_bin
=
os
.
path
.
splitext
(
self
.
model_detector_pth
)[
0
]
+
".bin"
self
.
ie
=
IECore
()
self
.
net1
=
self
.
ie
.
read_network
(
model
=
self
.
model_detector_pth
,
weights
=
self
.
model_bin
)
...
...
@@ -222,12 +222,13 @@ class Welspun_Classifier(ModelWrapper):
x
.
append
(
prob
[
1
])
x
.
append
(
prob
[
2
])
x
.
append
(
prob
[
3
])
x
.
append
(
prob
[
4
])
a
=
x
.
index
(
max
(
x
))
# print(type(prob))
# if self.counter%1 == 0:
self
.
counter
=
self
.
counter
+
1
if
a
==
0
and
x
[
0
]
>
0.95
:
if
a
==
1
and
x
[
1
]
>
0.95
:
if
self
.
defect_type
==
'Mix'
:
cv2
.
putText
(
frame
,
text
=
"Mix Color Defect Detected"
,
org
=
(
50
,
50
),
color
=
(
0
,
0
,
255
),
...
...
@@ -251,7 +252,7 @@ class Welspun_Classifier(ModelWrapper):
# "sound_1")
# logger.info(f"Probability: {prob}")
# self.counter = 0
elif
a
==
2
and
x
[
2
]
>
0.95
:
elif
a
==
3
and
x
[
3
]
>
0.95
:
if
self
.
defect_type
==
'Short'
:
cv2
.
putText
(
frame
,
text
=
"Short Defect Detected"
,
org
=
(
50
,
50
),
color
=
(
0
,
0
,
255
),
...
...
@@ -275,7 +276,7 @@ class Welspun_Classifier(ModelWrapper):
# "sound_1")
# logger.info(f"Probability: {prob}")
# self.counter = 0
elif
a
==
3
and
x
[
3
]
>
0.95
:
elif
a
==
4
and
x
[
4
]
>
0.95
:
if
self
.
defect_type
==
'Split'
:
cv2
.
putText
(
frame
,
text
=
"Split Defect Detected"
,
org
=
(
50
,
50
),
color
=
(
0
,
0
,
255
),
...
...
@@ -297,6 +298,28 @@ class Welspun_Classifier(ModelWrapper):
# "sound_1")
# logger.info(f"Probability: {prob}")
# self.counter = 0
elif
a
==
0
and
x
[
0
]
>
0.95
:
if
self
.
defect_type
==
'good'
:
cv2
.
putText
(
frame
,
text
=
"No Defect"
,
org
=
(
50
,
50
),
color
=
(
0
,
0
,
255
),
thickness
=
2
,
fontScale
=
1
,
fontFace
=
cv2
.
LINE_AA
)
# pass
else
:
self
.
defect_type
=
'good'
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
)
self
.
send_payload
(
"No Defect"
,
resized_frame
,
"no defect "
+
str
(
prob
[
3
]),
"#472020"
,
"#ed2020"
,
"sound_1"
)
logger
.
info
(
f
"Probability: {prob}"
)
# if self.counter % 25 == 0:
# self.send_payload("Split Defect Detected", resized_frame, "Split " + str(prob[3]), "#472020", "#ed2020",
# "sound_1")
# logger.info(f"Probability: {prob}")
# self.counter = 0
elif
a
==
2
:
pass
...
...
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