Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lucas Miranda
deepOF
Commits
c8817849
Commit
c8817849
authored
Sep 30, 2020
by
lucas_miranda
Browse files
refactored some functions
parent
3e5b4070
Pipeline
#83324
canceled with stage
in 17 minutes and 9 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
deepof/data.py
View file @
c8817849
...
...
@@ -680,6 +680,7 @@ class coordinates:
path
=
os
.
path
.
join
(
self
.
_path
,
"Videos"
),
hparams
=
hparams
,
)
pbar
.
update
(
1
)
if
type
(
video_output
)
==
list
:
vid_idxs
=
video_output
...
...
@@ -690,9 +691,11 @@ class coordinates:
"Video output must be either 'all' or a list with the names of the videos to render"
)
njobs
=
cpu_count
(
logical
=
True
)
njobs
=
cpu_count
(
logical
=
False
)
pbar
=
tqdm
(
total
=
len
(
vid_idxs
))
with
parallel_backend
(
"threading"
,
n_jobs
=
njobs
):
Parallel
()(
delayed
(
output_video
)(
key
)
for
key
in
vid_idxs
)
pbar
.
close
()
return
table_dict
(
tag_dict
,
typ
=
"rule-based"
,
arena
=
self
.
_arena
,
arena_dims
=
self
.
_arena_dims
...
...
deepof/pose_utils.py
View file @
c8817849
...
...
@@ -18,7 +18,6 @@ import regex as re
import
seaborn
as
sns
from
itertools
import
combinations
from
scipy
import
stats
from
tqdm
import
tqdm
from
typing
import
Any
,
List
,
NewType
Coordinates
=
NewType
(
"Coordinates"
,
Any
)
...
...
@@ -716,7 +715,6 @@ def rule_based_video(
)
# Loop over the frames in the video
pbar
=
tqdm
(
total
=
min
(
coords
.
shape
[
0
]
-
recog_limit
,
frame_limit
))
while
cap
.
isOpened
()
and
fnum
<
frame_limit
:
ret
,
frame
=
cap
.
read
()
...
...
@@ -766,8 +764,6 @@ def rule_based_video(
)
writer
.
write
(
frame
)
pbar
.
update
(
1
)
fnum
+=
1
cap
.
release
()
...
...
tests/test_data.py
View file @
c8817849
...
...
@@ -74,7 +74,7 @@ def test_project_properties():
prun
.
subset_condition
=
"testing"
assert
prun
.
subset_condition
==
"testing"
assert
prun
.
distances
==
"
A
ll"
assert
prun
.
distances
==
"
a
ll"
prun
.
distances
=
"testing"
assert
prun
.
distances
==
"testing"
...
...
@@ -94,7 +94,7 @@ def test_project_properties():
)
def
test_get_distances
(
nodes
,
ego
):
nodes
=
[
"
A
ll"
,
[
"Center"
,
"Nose"
,
"Tail_base"
]][
nodes
]
nodes
=
[
"
a
ll"
,
[
"Center"
,
"Nose"
,
"Tail_base"
]][
nodes
]
ego
=
[
False
,
"Center"
,
"Nose"
][
ego
]
prun
=
deepof
.
data
.
project
(
...
...
@@ -118,7 +118,7 @@ def test_get_distances(nodes, ego):
)
def
test_get_angles
(
nodes
,
ego
):
nodes
=
[
"
A
ll"
,
[
"Center"
,
"Nose"
,
"Tail_base"
]][
nodes
]
nodes
=
[
"
a
ll"
,
[
"Center"
,
"Nose"
,
"Tail_base"
]][
nodes
]
ego
=
[
False
,
"Center"
,
"Nose"
][
ego
]
prun
=
deepof
.
data
.
project
(
...
...
@@ -143,7 +143,7 @@ def test_get_angles(nodes, ego):
)
def
test_run
(
nodes
,
ego
):
nodes
=
[
"
A
ll"
,
[
"Center"
,
"Nose"
,
"Tail_base"
]][
nodes
]
nodes
=
[
"
a
ll"
,
[
"Center"
,
"Nose"
,
"Tail_base"
]][
nodes
]
ego
=
[
False
,
"Center"
,
"Nose"
][
ego
]
prun
=
deepof
.
data
.
project
(
...
...
@@ -185,7 +185,7 @@ def test_get_rule_based_annotation():
)
def
test_get_table_dicts
(
nodes
,
ego
,
sampler
):
nodes
=
[
"
A
ll"
,
[
"Center"
,
"Nose"
,
"Tail_base"
]][
nodes
]
nodes
=
[
"
a
ll"
,
[
"Center"
,
"Nose"
,
"Tail_base"
]][
nodes
]
ego
=
[
False
,
"Center"
,
"Nose"
][
ego
]
prun
=
deepof
.
data
.
project
(
...
...
tests/test_examples/Tables/test_csv_table.csv
→
tests/test_examples/Tables/test
DLC
_csv_table.csv
View file @
c8817849
File moved
tests/test_examples/Tables/test_h5_table.h5
→
tests/test_examples/Tables/test
DLC
_h5_table.h5
View file @
c8817849
File moved
tests/test_examples/Videos/test_video_circular_arena.mp4
→
tests/test_examples/Videos/test
DLC
_video_circular_arena.mp4
View file @
c8817849
File moved
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