Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
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
FruitBin
Commits
27f8ce78
Commit
27f8ce78
authored
2 years ago
by
Guillaume Duret
Browse files
Options
Downloads
Patches
Plain Diff
add high quality
parent
ec417408
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compute_features.py
+1
-2
1 addition, 2 deletions
compute_features.py
main.py
+11
-7
11 additions, 7 deletions
main.py
with
12 additions
and
9 deletions
compute_features.py
+
1
−
2
View file @
27f8ce78
...
@@ -18,6 +18,7 @@ def process_compute(data_name, camera, camera_resized, new_size, Nb_camera, Worl
...
@@ -18,6 +18,7 @@ def process_compute(data_name, camera, camera_resized, new_size, Nb_camera, Worl
[
1.0000000
,
0.0000000
,
0.0000000
]])
[
1.0000000
,
0.0000000
,
0.0000000
]])
list_count_categories
=
{}
list_count_categories
=
{}
for
i
in
range
(
World_begin
,
World_begin
+
Nb_world
):
# worlds
for
i
in
range
(
World_begin
,
World_begin
+
Nb_world
):
# worlds
catergories_instance_array_id_to_cat
,
catergories_instance_array_cat_to_id
,
catergories_label_to_id
=
compute_categories_id
(
data_name
,
i
)
catergories_instance_array_id_to_cat
,
catergories_instance_array_cat_to_id
,
catergories_label_to_id
=
compute_categories_id
(
data_name
,
i
)
...
@@ -86,9 +87,7 @@ def process_compute(data_name, camera, camera_resized, new_size, Nb_camera, Worl
...
@@ -86,9 +87,7 @@ def process_compute(data_name, camera, camera_resized, new_size, Nb_camera, Worl
f
.
write
(
json
.
dumps
(
feeds
,
indent
=
4
))
f
.
write
(
json
.
dumps
(
feeds
,
indent
=
4
))
if
(
Nb_instance
==
1
):
if
(
Nb_instance
==
1
):
for
k
in
range
(
len
(
data_3D_pose
)):
for
k
in
range
(
len
(
data_3D_pose
)):
if
data_3D_pose
[
k
][
'
id
'
]
==
catergories_occ_array
[
categories
][
0
]:
if
data_3D_pose
[
k
][
'
id
'
]
==
catergories_occ_array
[
categories
][
0
]:
rpy
=
data_3D_pose
[
k
][
'
pose
'
][
'
rpy
'
]
rpy
=
data_3D_pose
[
k
][
'
pose
'
][
'
rpy
'
]
rot
=
convert2
(
rpy
)
rot
=
convert2
(
rpy
)
...
...
This diff is collapsed.
Click to expand it.
main.py
+
11
−
7
View file @
27f8ce78
...
@@ -50,7 +50,7 @@ if __name__ == '__main__':
...
@@ -50,7 +50,7 @@ if __name__ == '__main__':
Nb_instance
=
1
Nb_instance
=
1
occ_target
=
0.5
occ_target
=
0.5
dataset_src
=
"
/media/gduret/DATA/dataset/s2rg/Fruits_all_medium/data
"
dataset_src
=
"
/media/gduret/DATA/dataset/s2rg/Fruits_all_medium/data
"
choice
=
"
low
"
# depth of rgb resolution datas
choice
=
"
high
"
# depth of rgb resolution datas
data_options
=
{
"
high
"
:
"
ground_truth_rgb
"
,
data_options
=
{
"
high
"
:
"
ground_truth_rgb
"
,
"
low
"
:
"
ground_truth_depth
"
}
"
low
"
:
"
ground_truth_depth
"
}
dataset_type
=
data_options
[
choice
]
dataset_type
=
data_options
[
choice
]
...
@@ -64,17 +64,21 @@ if __name__ == '__main__':
...
@@ -64,17 +64,21 @@ if __name__ == '__main__':
camera
=
np
.
matrix
([[
1386.4138492513919
,
0.0
,
960.5
],
camera
=
np
.
matrix
([[
1386.4138492513919
,
0.0
,
960.5
],
[
0.0
,
1386.4138492513919
,
540.5
],
[
0.0
,
1386.4138492513919
,
540.5
],
[
0.0
,
0.0
,
1.0
]])
[
0.0
,
0.0
,
1.0
]])
else
:
# (640/1920 = 1 / 3), (480/1080 = 4 / 9)
trans
=
np
.
matrix
([[
1
/
3
,
0.0
,
0.0
],
[
0.0
,
(
4
/
9
),
0.0
],
[
0.0
,
0.0
,
1.0
]])
elif
choice
==
'
low
'
:
camera
=
np
.
matrix
([[
1086.5054444841007
,
0.0
,
640.5
],
camera
=
np
.
matrix
([[
1086.5054444841007
,
0.0
,
640.5
],
[
0.0
,
1086.5054444841007
,
360.5
],
[
0.0
,
1086.5054444841007
,
360.5
],
[
0.0
,
0.0
,
1.0
]])
[
0.0
,
0.0
,
1.0
]])
#
trans
=
np
.
matrix
([[
0.5
,
0.0
,
0.0
],
[
0.0
,
(
2
/
3
),
0.0
],
[
0.0
,
0.0
,
1.0
]])
new_size
=
(
640
,
480
)
new_size
=
(
640
,
480
)
trans
=
np
.
matrix
([[
0.5
,
0.0
,
0.0
],
[
0.0
,
(
2
/
3
),
0.0
],
[
0.0
,
0.0
,
1.0
]])
new_camera
=
trans
@
camera
new_camera
=
trans
@
camera
np
.
savetxt
(
f
'
{
dataset_name
}
/Generated/camera_
{
choice
}
.txt
'
,
camera
)
np
.
savetxt
(
f
'
{
dataset_name
}
/Generated/camera_
{
choice
}
.txt
'
,
camera
)
...
@@ -107,5 +111,5 @@ if __name__ == '__main__':
...
@@ -107,5 +111,5 @@ if __name__ == '__main__':
bbox
=
get_3D_bbox
(
ext
)
bbox
=
get_3D_bbox
(
ext
)
np
.
savetxt
(
f
'
{
dataset_name
}
/Generated/
{
categories
}
/
{
categories
}
_bbox_3d.txt
'
,
bbox
)
# save
np
.
savetxt
(
f
'
{
dataset_name
}
/Generated/
{
categories
}
/
{
categories
}
_bbox_3d.txt
'
,
bbox
)
# save
process_compute
(
dataset_name
,
camera
,
new_camera
,
new_size
,
Nb_camera
,
args
.
World_begin
,
args
.
Nb_worlds
,
list_categories
,
occ_target
,
Fals
e
)
process_compute
(
dataset_name
,
camera
,
new_camera
,
new_size
,
Nb_camera
,
args
.
World_begin
,
args
.
Nb_worlds
,
list_categories
,
occ_target
,
Tru
e
)
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