Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.pytorch
Commits
544151d3
Commit
544151d3
authored
Jan 29, 2019
by
Guillaume HEUSCH
Browse files
[utils] fixed the map_label function (hopefully)
parent
0f9a2e11
Pipeline
#26413
failed with stages
in 6 minutes and 45 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/learn/pytorch/datasets/utils.py
View file @
544151d3
...
...
@@ -84,8 +84,14 @@ class ToGray(object):
def
map_labels
(
raw_labels
,
start_index
=
0
):
"""
Map the ID label to [0 - # of IDs]
Parameters
----------
raw_labels: list of int
The labels of the samples
"""
possible_labels
=
list
(
set
(
raw_labels
))
possible_labels
=
sorted
(
list
(
set
(
raw_labels
))
)
labels
=
numpy
.
array
(
raw_labels
)
for
i
in
range
(
len
(
possible_labels
)):
...
...
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