Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pvnet_FruitBIn
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Guillaume Duret
Pvnet_FruitBIn
Commits
8dc0b495
Commit
8dc0b495
authored
2 years ago
by
maali
Browse files
Options
Downloads
Patches
Plain Diff
Add getAllValDataFruits function
parent
b0129f48
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
data.py
+20
-0
20 additions, 0 deletions
data.py
with
20 additions
and
0 deletions
data.py
+
20
−
0
View file @
8dc0b495
...
...
@@ -54,6 +54,26 @@ def getAllValData(modelClass='cat'): # retrieves random image and label set fro
return
image_ls
,
labels_ls
,
mask_ls
def
getAllValDataFruits
(
modelClass
=
'
cat
'
):
# retrieves random image and label set from specified dataset
trainData
,
validData
=
getDataSplit_Fruits
(
modelClass
=
modelClass
)
basePath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
+
'
/Generated_Worlds_/Generated_Worlds_Evaluating/
'
+
modelClass
image_ls
=
[]
labels_ls
=
[]
mask_ls
=
[]
choice_ls
=
[]
for
choice
in
validData
:
with
open
(
basePath
+
'
/FPS_resized/
'
+
choice
[
2
])
as
f
:
labels
=
f
.
readline
().
split
(
'
'
)[
1
:
19
]
labels_ls
.
append
(
labels
)
image
=
filePathToArray
(
basePath
+
'
/RGB_resized/
'
+
choice
[
0
])
mask
=
filePathToArray
(
basePath
+
'
/Instance_Mask_resized/
'
+
choice
[
1
])
image_ls
.
append
(
image
)
mask_ls
.
append
(
mask
)
choice_ls
.
append
(
choice
[
0
])
return
image_ls
,
labels_ls
,
mask_ls
,
choice_ls
def
getMasterList
(
basePath
):
# returns list with image, mask, and label filenames
imageList
=
sorted
(
os
.
listdir
(
basePath
+
'
/rgb/
'
))
maskList
=
sorted
(
os
.
listdir
(
basePath
+
'
/mask/
'
))
...
...
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