Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
CHILD INTELLIGENT ASSESSMENT TOOL
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
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2020-046
CHILD INTELLIGENT ASSESSMENT TOOL
Commits
2a595f5d
Commit
2a595f5d
authored
Jul 09, 2020
by
Gunasinghe M.D.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete image_proprocessing.py
parent
3e30946b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
40 deletions
+0
-40
image_proprocessing.py
image_proprocessing.py
+0
-40
No files found.
image_proprocessing.py
deleted
100644 → 0
View file @
3e30946b
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Gunasinghe M.D.
"""
# Image Preprocessing for train, test and validation sets
import
os
import
random
import
glob
def
prepare_test_data
(
n
):
base_path
=
"shapes"
f1
=
random
.
sample
(
glob
.
glob
(
os
.
path
.
join
(
base_path
,
"test/circles"
)
+
"/*"
),
n
)
f2
=
random
.
sample
(
glob
.
glob
(
os
.
path
.
join
(
base_path
,
"test/squares"
)
+
"/*"
),
n
)
f3
=
random
.
sample
(
glob
.
glob
(
os
.
path
.
join
(
base_path
,
"test/triangles"
)
+
"/*"
),
n
)
for
c
in
f1
:
os
.
remove
(
c
)
for
s
in
f2
:
os
.
remove
(
s
)
for
t
in
f3
:
os
.
remove
(
t
)
def
prepare_validation_data
(
n
):
base_path
=
"shapes"
f1
=
random
.
sample
(
glob
.
glob
(
os
.
path
.
join
(
base_path
,
"validation/circles"
)
+
"/*"
),
n
)
f2
=
random
.
sample
(
glob
.
glob
(
os
.
path
.
join
(
base_path
,
"validation/squares"
)
+
"/*"
),
n
)
f3
=
random
.
sample
(
glob
.
glob
(
os
.
path
.
join
(
base_path
,
"validation/triangles"
)
+
"/*"
),
n
)
for
c
in
f1
:
os
.
remove
(
c
)
for
s
in
f2
:
os
.
remove
(
s
)
for
t
in
f3
:
os
.
remove
(
t
)
# n = number of samples to remove from each categorical folder
prepare_test_data
(
70
)
prepare_validation_data
(
40
)
\ No newline at end of file
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