Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 063a10e5 authored by zinsmatt's avatar zinsmatt
Browse files

Update scene file architecture and doc

parent 3bdb1565
No related branches found
No related tags found
No related merge requests found
...@@ -61,18 +61,25 @@ You can easily apply the method on your own dataset. There are only two required ...@@ -61,18 +61,25 @@ You can easily apply the method on your own dataset. There are only two required
The localization method is based on a scene model in the form of an ellipsoid cloud. We adopted a simple JSON format this scene model, describing the ellipoids with some semantic information (i.e the object category). The localization method is based on a scene model in the form of an ellipsoid cloud. We adopted a simple JSON format this scene model, describing the ellipoids with some semantic information (i.e the object category).
```jsonc ```jsonc
[ {
{ "category_id_to_label": {
"category_id": 3, "0": "tv",
"object_id": 7, "1": "chair",
"ellipse": { // ...
"axes": [0.1, 0.2, 0.3],
"R": [], // 3x3 rotation matrix
"center": [0.2, 0.2, 0.4],
}
}, },
// ... "objects": [
] {
"category_id": 3,
"object_id": 7,
"ellipsoid": {
"axes": [0.1, 0.2, 0.3],
"R": [], // 3x3 rotation matrix
"center": [0.2, 0.2, 0.4],
}
},
// ...
]
}
``` ```
We provide a scene model for the Chess scene of the 7-Scene dataset, composed of 11 objects (from 7 cateories) on the Chess scene of the 7-Scenes dataset. We provide a scene model for the Chess scene of the 7-Scene dataset, composed of 11 objects (from 7 cateories) on the Chess scene of the 7-Scenes dataset.
...@@ -139,12 +146,12 @@ Pre-trained weights for the ellipse prediction part on the Chess scene can be do ...@@ -139,12 +146,12 @@ Pre-trained weights for the ellipse prediction part on the Chess scene can be do
To train the ellipse prediction network for each object of you scene, run: To train the ellipse prediction network for each object of you scene, run:
``` ```
python train_ellipse_prediction.py scene.json 7-Scenes_Chess_dataset_train_with_obj_annot.json 7-Scenes_Chess_dataset_test_with_obj_annot.json ellipses_checkpoints [--nb_epochs 300] python train_ellipse_prediction.py data/7-Scenes_Chess_scene.json 7-Scenes_Chess_dataset_train_with_obj_annot.json 7-Scenes_Chess_dataset_test_with_obj_annot.json ellipses_checkpoints [--nb_epochs 300]
``` ```
### Evaluation ### Evaluation
``` ```
python eval_ellipse_prediction.py scene.json 7-Scenes_Chess_dataset_test_with_obj_annot.json ellipses_checkpoints [--output_images out_folder] python eval_ellipse_prediction.py data/7-Scenes_Chess_scene.json 7-Scenes_Chess_dataset_test_with_obj_annot.json ellipses_checkpoints [--output_images out_folder]
``` ```
...@@ -174,7 +181,7 @@ The `config.py` file contains parameters that can be changed. Especially, it def ...@@ -174,7 +181,7 @@ The `config.py` file contains parameters that can be changed. Especially, it def
Run the following command: Run the following command:
``` ```
python run.py scene.json 7-Scenes_Chess_dataset_test.json detector_checkpoint/final.pth ellipses_checkpoints --visualize [--output_images output_folder --skip_frames 50 --output_predictions predictions.json --output_errors errors] python run.py data/7-Scenes_Chess_scene.json 7-Scenes_Chess_dataset_test.json detector_checkpoint/final.pth ellipses_checkpoints --visualize [--output_images output_folder --skip_frames 50 --output_predictions predictions.json --output_errors errors]
``` ```
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
{ {
"category_id": 0, "category_id": 0,
"object_id": 0, "object_id": 0,
"ellipse": { "ellipsoid": {
"axes": [ "axes": [
0.17790342378298427, 0.17790342378298427,
0.4196947342281149, 0.4196947342281149,
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
{ {
"category_id": 0, "category_id": 0,
"object_id": 1, "object_id": 1,
"ellipse": { "ellipsoid": {
"axes": [ "axes": [
0.4433777080322151, 0.4433777080322151,
0.343021362184948, 0.343021362184948,
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
{ {
"category_id": 1, "category_id": 1,
"object_id": 2, "object_id": 2,
"ellipse": { "ellipsoid": {
"axes": [ "axes": [
0.2845037494354427, 0.2845037494354427,
0.18057472335963232, 0.18057472335963232,
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
{ {
"category_id": 1, "category_id": 1,
"object_id": 3, "object_id": 3,
"ellipse": { "ellipsoid": {
"axes": [ "axes": [
0.2364234654295947, 0.2364234654295947,
0.1746075948167475, 0.1746075948167475,
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
{ {
"category_id": 2, "category_id": 2,
"object_id": 4, "object_id": 4,
"ellipse": { "ellipsoid": {
"axes": [ "axes": [
0.2130813372990089, 0.2130813372990089,
0.15798663400711946, 0.15798663400711946,
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
{ {
"category_id": 2, "category_id": 2,
"object_id": 5, "object_id": 5,
"ellipse": { "ellipsoid": {
"axes": [ "axes": [
0.24055877935769834, 0.24055877935769834,
0.1439650208931686, 0.1439650208931686,
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
{ {
"category_id": 2, "category_id": 2,
"object_id": 6, "object_id": 6,
"ellipse": { "ellipsoid": {
"axes": [ "axes": [
0.11021662375625348, 0.11021662375625348,
0.25072606804543834, 0.25072606804543834,
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
{ {
"category_id": 3, "category_id": 3,
"object_id": 7, "object_id": 7,
"ellipse": { "ellipsoid": {
"axes": [ "axes": [
0.11144366319435015, 0.11144366319435015,
0.05186568254044441, 0.05186568254044441,
...@@ -276,7 +276,7 @@ ...@@ -276,7 +276,7 @@
{ {
"category_id": 4, "category_id": 4,
"object_id": 8, "object_id": 8,
"ellipse": { "ellipsoid": {
"axes": [ "axes": [
0.176306186807118, 0.176306186807118,
0.09696996280232797, 0.09696996280232797,
...@@ -309,7 +309,7 @@ ...@@ -309,7 +309,7 @@
{ {
"category_id": 5, "category_id": 5,
"object_id": 9, "object_id": 9,
"ellipse": { "ellipsoid": {
"axes": [ "axes": [
0.025678840931716667, 0.025678840931716667,
0.06426116845378854, 0.06426116845378854,
...@@ -342,7 +342,7 @@ ...@@ -342,7 +342,7 @@
{ {
"category_id": 6, "category_id": 6,
"object_id": 10, "object_id": 10,
"ellipse": { "ellipsoid": {
"axes": [ "axes": [
0.08824363472966783, 0.08824363472966783,
0.06515494036182076, 0.06515494036182076,
......
...@@ -18,7 +18,7 @@ class Scene_loader: ...@@ -18,7 +18,7 @@ class Scene_loader:
obj_data = { obj_data = {
"category_id": obj["category_id"], "category_id": obj["category_id"],
"object_id": obj["object_id"], "object_id": obj["object_id"],
"ellipsoid": Ellipsoid.from_dict(obj["ellipse"]) "ellipsoid": Ellipsoid.from_dict(obj["ellipsoid"])
} }
self.object_id_map[obj["object_id"]] = len(self.objects) self.object_id_map[obj["object_id"]] = len(self.objects)
self.objects.append(obj_data) self.objects.append(obj_data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment