Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Container 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
bioroboticslab
robofish
io
Commits
1d8fb2df
Commit
1d8fb2df
authored
3 years ago
by
mhocke
Committed by
Andi Gerken
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Show values of text datasets in title of render view.
parent
756cc2f1
Branches
Branches containing commit
No related tags found
1 merge request
!26
Show values of text datasets in title of render view
Pipeline
#48442
passed
3 years ago
Stage: package
Stage: test
Stage: deploy
Stage: trigger
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/robofish/io/app.py
+1
-0
1 addition, 0 deletions
src/robofish/io/app.py
src/robofish/io/file.py
+17
-2
17 additions, 2 deletions
src/robofish/io/file.py
with
18 additions
and
2 deletions
src/robofish/io/app.py
+
1
−
0
View file @
1d8fb2df
...
@@ -129,6 +129,7 @@ def render(args=None):
...
@@ -129,6 +129,7 @@ def render(args=None):
"
view_size
"
:
60
,
"
view_size
"
:
60
,
"
slow_view
"
:
0.8
,
"
slow_view
"
:
0.8
,
"
cut_frames
"
:
0
,
"
cut_frames
"
:
0
,
"
show_text
"
:
False
,
}
}
for
key
,
value
in
default_options
.
items
():
for
key
,
value
in
default_options
.
items
():
...
...
This diff is collapsed.
Click to expand it.
src/robofish/io/file.py
+
17
−
2
View file @
1d8fb2df
...
@@ -836,6 +836,7 @@ class File(h5py.File):
...
@@ -836,6 +836,7 @@ class File(h5py.File):
"
slow_view
"
:
0.8
,
"
slow_view
"
:
0.8
,
"
slow_zoom
"
:
0.95
,
"
slow_zoom
"
:
0.95
,
"
cut_frames
"
:
None
,
"
cut_frames
"
:
None
,
"
show_text
"
:
False
,
}
}
options
=
{
options
=
{
...
@@ -851,9 +852,12 @@ class File(h5py.File):
...
@@ -851,9 +852,12 @@ class File(h5py.File):
plt
.
plot
([],
[],
lw
=
options
[
"
linewidth
"
],
zorder
=
0
)[
0
]
plt
.
plot
([],
[],
lw
=
options
[
"
linewidth
"
],
zorder
=
0
)[
0
]
for
_
in
range
(
n_entities
)
for
_
in
range
(
n_entities
)
]
]
categories
=
[
entity
.
attrs
.
get
(
"
category
"
,
None
)
for
entity
in
self
.
entities
]
entity_polygons
=
[
entity_polygons
=
[
patches
.
Polygon
(
shape_vertices
(
options
[
"
entity_scale
"
]),
facecolor
=
"
k
"
)
patches
.
Polygon
(
shape_vertices
(
options
[
"
entity_scale
"
]),
facecolor
=
color
)
for
_
in
range
(
n_entities
)
for
color
in
[
"
gray
"
if
category
==
"
robot
"
else
"
k
"
for
category
in
categories
]
]
]
border_vertices
=
np
.
array
(
border_vertices
=
np
.
array
(
...
@@ -883,6 +887,15 @@ class File(h5py.File):
...
@@ -883,6 +887,15 @@ class File(h5py.File):
min_view
=
np
.
max
((
np
.
max
(
start_pose
,
axis
=
0
)
-
np
.
min
(
start_pose
,
axis
=
0
))[:
2
])
min_view
=
np
.
max
((
np
.
max
(
start_pose
,
axis
=
0
)
-
np
.
min
(
start_pose
,
axis
=
0
))[:
2
])
self
.
view_size
=
np
.
max
([
options
[
"
view_size
"
],
min_view
+
options
[
"
margin
"
]])
self
.
view_size
=
np
.
max
([
options
[
"
view_size
"
],
min_view
+
options
[
"
margin
"
]])
def
title
(
file_frame
:
int
)
->
str
:
"""
Search for datasets containing text for displaying it in the video
"""
output
=
[]
for
e
in
self
.
entities
:
for
key
,
val
in
e
.
items
():
if
val
.
dtype
==
object
and
type
(
val
[
0
])
==
bytes
:
output
.
append
(
f
"
{
e
.
name
}
.
{
key
}
=
'
{
val
[
file_frame
].
decode
()
}
'"
)
return
"
,
"
.
join
(
output
)
def
init
():
def
init
():
ax
.
set_xlim
(
-
0.5
*
self
.
world_size
[
0
],
0.5
*
self
.
world_size
[
0
])
ax
.
set_xlim
(
-
0.5
*
self
.
world_size
[
0
],
0.5
*
self
.
world_size
[
0
])
ax
.
set_ylim
(
-
0.5
*
self
.
world_size
[
1
],
0.5
*
self
.
world_size
[
1
])
ax
.
set_ylim
(
-
0.5
*
self
.
world_size
[
1
],
0.5
*
self
.
world_size
[
1
])
...
@@ -943,6 +956,8 @@ class File(h5py.File):
...
@@ -943,6 +956,8 @@ class File(h5py.File):
self
.
middle_of_swarm
[
1
]
-
self
.
view_size
/
2
,
self
.
middle_of_swarm
[
1
]
-
self
.
view_size
/
2
,
self
.
middle_of_swarm
[
1
]
+
self
.
view_size
/
2
,
self
.
middle_of_swarm
[
1
]
+
self
.
view_size
/
2
,
)
)
if
options
[
"
show_text
"
]:
ax
.
set_title
(
title
(
file_frame
))
poses_trails
=
entity_poses
[
poses_trails
=
entity_poses
[
:,
max
(
0
,
file_frame
-
options
[
"
trail
"
])
:
file_frame
:,
max
(
0
,
file_frame
-
options
[
"
trail
"
])
:
file_frame
...
...
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