Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IA DETECTION SIGNE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KHRIS Badreddine
IA DETECTION SIGNE
Commits
2262514f
Commit
2262514f
authored
2 years ago
by
computervisiondeveloper
Browse files
Options
Downloads
Patches
Plain Diff
Edit data creation to improve robustness.
parent
c90bc753
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
create_dataset.py
+13
-2
13 additions, 2 deletions
create_dataset.py
inference_classifier.py
+7
-2
7 additions, 2 deletions
inference_classifier.py
with
20 additions
and
4 deletions
create_dataset.py
+
13
−
2
View file @
2262514f
...
...
@@ -19,6 +19,10 @@ labels = []
for
dir_
in
os
.
listdir
(
DATA_DIR
):
for
img_path
in
os
.
listdir
(
os
.
path
.
join
(
DATA_DIR
,
dir_
)):
data_aux
=
[]
x_
=
[]
y_
=
[]
img
=
cv2
.
imread
(
os
.
path
.
join
(
DATA_DIR
,
dir_
,
img_path
))
img_rgb
=
cv2
.
cvtColor
(
img
,
cv2
.
COLOR_BGR2RGB
)
...
...
@@ -28,8 +32,15 @@ for dir_ in os.listdir(DATA_DIR):
for
i
in
range
(
len
(
hand_landmarks
.
landmark
)):
x
=
hand_landmarks
.
landmark
[
i
].
x
y
=
hand_landmarks
.
landmark
[
i
].
y
data_aux
.
append
(
x
)
data_aux
.
append
(
y
)
x_
.
append
(
x
)
y_
.
append
(
y
)
for
i
in
range
(
len
(
hand_landmarks
.
landmark
)):
x
=
hand_landmarks
.
landmark
[
i
].
x
y
=
hand_landmarks
.
landmark
[
i
].
y
data_aux
.
append
(
x
-
min
(
x_
))
data_aux
.
append
(
y
-
min
(
y_
))
data
.
append
(
data_aux
)
labels
.
append
(
dir_
)
...
...
This diff is collapsed.
Click to expand it.
inference_classifier.py
+
7
−
2
View file @
2262514f
...
...
@@ -42,11 +42,16 @@ while True:
for
i
in
range
(
len
(
hand_landmarks
.
landmark
)):
x
=
hand_landmarks
.
landmark
[
i
].
x
y
=
hand_landmarks
.
landmark
[
i
].
y
data_aux
.
append
(
x
)
data_aux
.
append
(
y
)
x_
.
append
(
x
)
y_
.
append
(
y
)
for
i
in
range
(
len
(
hand_landmarks
.
landmark
)):
x
=
hand_landmarks
.
landmark
[
i
].
x
y
=
hand_landmarks
.
landmark
[
i
].
y
data_aux
.
append
(
x
-
min
(
x_
))
data_aux
.
append
(
y
-
min
(
y_
))
x1
=
int
(
min
(
x_
)
*
W
)
-
10
y1
=
int
(
min
(
y_
)
*
H
)
-
10
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment