Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FLiTrak3D
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container 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
Cribellier, Antoine
FLiTrak3D
Commits
3a061f62
Commit
3a061f62
authored
2 years ago
by
Cribellier, Antoine
Browse files
Options
Downloads
Patches
Plain Diff
Added TODO + docstring of do_batch + correct input for delete_recordings()
parent
a74fff85
No related branches found
No related tags found
1 merge request
!7
Improved architecture, documentation and flexibility, added working tests for preprocessing of images
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
process/batch_processing.py
+12
-11
12 additions, 11 deletions
process/batch_processing.py
tests/test_process_batch.py
+2
-0
2 additions, 0 deletions
tests/test_process_batch.py
with
14 additions
and
11 deletions
process/batch_processing.py
+
12
−
11
View file @
3a061f62
...
...
@@ -275,7 +275,14 @@ class BatchProcessing:
yaml
.
safe_dump
(
process_dict
,
yaml_file
,
encoding
=
'
utf-8
'
,
allow_unicode
=
True
)
def
do_batch
(
self
,
fn_name
:
str
,
**
kwargs
)
->
None
:
def
do_batch
(
self
,
fn_name
:
str
,
**
kwargs
:
Dict
[
str
,
any
])
->
None
:
"""
Args:
fn_name: Name of the function to run the batch on (e.g.
'
track2d
'
,
'
crop
'
,
'
analyse_dlc
'
,
'
fit_skeleton
'
)
**kwargs: A dictionary with the process parameters
"""
start
=
time
.
time
()
step_frame
=
1
if
'
step_frame
'
not
in
kwargs
.
keys
()
else
kwargs
[
'
step_frame
'
]
...
...
@@ -394,7 +401,9 @@ class BatchProcessing:
img
.
close
()
if
will_delete_rec
:
self
.
delete_recordings
(
rec_dates
,
self
.
recordings
.
get_paths
)
rec_names_to_del
=
{
camn
:
recording
.
get
(
camn
).
get_names
()
for
camn
in
range
(
1
,
self
.
nb_cam
+
1
)}
rec_paths_to_del
=
{
camn
:
recording
.
get
(
camn
).
get_paths
()
for
camn
in
range
(
1
,
self
.
nb_cam
+
1
)}
self
.
delete_recordings
(
rec_names_to_del
,
rec_paths_to_del
)
elif
fn_name
==
'
stitch
'
:
stitch_all_images
(
image_names
,
image_paths
,
save_paths
,
self
.
main_camn
)
...
...
@@ -648,13 +657,8 @@ class BatchProcessing:
if
__name__
==
'
__main__
'
:
# TODO update loading BatchProcessing from path
img_process
=
BatchProcessing
()
#path = 'G:'
#img_process.cam_paths = {1: os.path.join(path, 'test'), 2: os.path.join(path, 'test'), 3: os.path.join(path, 'test')}
#img_process.cam_save_paths = {1: os.path.join(path, 'test', '_Process'), 2: os.path.join(path, 'test', '_Process'), 3: os.path.join(path, 'test', '_Process')}
#img_process.cam_paths = {1: 'F:\\Photron1', 2: 'Y:\\', 3: 'Z:\\'}
#img_process.cam_save_paths = {1: 'F:\\Photron1\\_Process', 2: 'Y:\\_Process', 3: 'Z:\\_Process'}
img_process
.
cam_paths
=
{
1
:
'
/media/user/MosquitoEscape_Photron1/Photron1
'
,
2
:
'
/media/user/MosquitoEscape_Photron2/Photron2
'
,
3
:
'
/media/user/MosquitoEscape_Photron3/Photron3
'
}
...
...
@@ -662,9 +666,6 @@ if __name__ == '__main__':
2
:
'
/media/user/MosquitoEscape_Photron2/Photron2/_Process
'
,
3
:
'
/media/user/MosquitoEscape_Photron3/Photron3/_Process
'
}
#img_process.cam_paths = {1: 'F:\\Photron1'}
#img_process.cam_save_paths = {1: 'F:\\Photron1\\_Process'}
img_process
.
init_paths_names
()
rec_names_to_process
=
{}
for
i
in
range
(
1
,
img_process
.
nb_cam
+
1
):
...
...
This diff is collapsed.
Click to expand it.
tests/test_process_batch.py
+
2
−
0
View file @
3a061f62
...
...
@@ -21,6 +21,8 @@ def test_batch_processing_images_preprocessing() -> None:
#gen_dlt(3, img_size, xyz_path, xy_path, dlt_path)
img_process
=
BatchProcessing
()
# TODO update loading BatchProcessing from path
img_process
.
cam_paths
=
{
1
:
'
/media/user/MosquitoLanding_Photron3_Backup/Photron1/_MatingKinematics
'
,
2
:
'
/media/user/MosquitoLanding_Photron3_Backup/Photron2/_MatingKinematics
'
,
3
:
'
/media/user/MosquitoLanding_Photron3_Backup/Photron3/_MatingKinematics
'
}
...
...
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