Skip to content

Commit

Permalink
docs: update the jupiter notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanchristopheruel committed Aug 23, 2024
1 parent 22f3dcf commit 9f13d68
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
11 changes: 6 additions & 5 deletions notebooks/general_template_matching_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"source": [
"### Environment Set-up\n",
"\n",
"* If running locally using jupyter, first install `openfdcm==0.9.0` in your environment using the installation instructions in the repository.\n",
"* If running locally using jupyter, first install `openfdcm==0.10.0` in your environment using the installation instructions in the repository.\n",
"\n",
"* If running from Google Colab, set using_colab=True below and run the cell."
]
Expand Down Expand Up @@ -76,8 +76,8 @@
"# Install required libraries\n",
"if using_colab:\n",
" import sys\n",
" !{sys.executable} -m pip install openfdcm==0.9.0\n",
" !git clone --branch v0.8.3 --single-branch --depth 1 https://github.com/Innoptech/OpenFDCM\n",
" !{sys.executable} -m pip install openfdcm==0.10.0\n",
" !git clone --branch v0.10.0 --single-branch --depth 1 https://github.com/Innoptech/OpenFDCM\n",
" %matplotlib inline"
]
},
Expand Down Expand Up @@ -288,19 +288,20 @@
"# Perform template matching using OpenFDCM\n",
"max_tmpl_lines, max_scene_lines = 3, 10 # Combinatory search parameters, the greater deetctions the better but slower.\n",
"depth = 30 # The [0, pi] discretization.\n",
"scene_padding = 1.0 # A ratio to pad the scene images used in the FDCM algorithm, use if best match may appear on image boundaries.\n",
"coeff = 5.0 # A weighting factor to enhance the angular cost vs distance cost in FDCM algorithm.\n",
"scene_padding = 1.0 # A ratio to pad the scene images used in the FDCM algorithm, use if best match may appear on image boundaries.\n",
"distance_type = openfdcm.distance.L2 # or openfdcm.distance.L2_SQUARED or openfdcm.distance.L1\n",
"#num_threads = 4\n",
"\n",
"threadpool = openfdcm.ThreadPool() # could pass num_threads here, but default is optimal\n",
"featuremap_params = openfdcm.Dt3CpuParameters(depth, coeff, scene_padding, distance_type)\n",
"search_strategy = openfdcm.DefaultSearch(max_tmpl_lines, max_scene_lines)\n",
"optimizer_strategy = openfdcm.BatchOptimize(5, threadpool)\n",
"matcher = openfdcm.DefaultMatch()\n",
"# Penalize each match with 1/n^tau where n is the number of line in the template\n",
"penalizer = openfdcm.ExponentialPenalty(tau=1.5)\n",
"\n",
"start_time = time.time()\n",
"featuremap_params = openfdcm.Dt3CpuParameters(depth=depth, dt3Coeff=coeff, padding=scene_padding)\n",
"featuremap = openfdcm.build_cpu_featuremap(scene_lines, featuremap_params, threadpool)\n",
"raw_matches = openfdcm.search(matcher, search_strategy, optimizer_strategy, featuremap, all_templates, scene_lines)\n",
"penalized_matches = openfdcm.penalize(penalizer, raw_matches, openfdcm.get_template_lengths(all_templates))\n",
Expand Down
13 changes: 7 additions & 6 deletions notebooks/pose_extimation_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"\n",
"### Environment Set-up\n",
"\n",
"* If running locally using jupyter, first install `openfdcm==0.9.0` in your environment using the installation instructions in the repository.\n",
"* If running locally using jupyter, first install `openfdcm==0.10.0` in your environment using the installation instructions in the repository.\n",
"\n",
"* If running from Google Colab, set using_colab=True below and run the cell.\n",
"\n"
Expand Down Expand Up @@ -81,8 +81,8 @@
"# Install required libraries\n",
"if using_colab:\n",
" import sys\n",
" !{sys.executable} -m pip install openfdcm==0.9.0\n",
" !git clone --branch v0.9.0 --single-branch --depth 1 https://github.com/Innoptech/OpenFDCM\n",
" !{sys.executable} -m pip install openfdcm==0.10.0\n",
" !git clone --branch v0.10.0 --single-branch --depth 1 https://github.com/Innoptech/OpenFDCM\n",
"\n"
]
},
Expand Down Expand Up @@ -214,13 +214,14 @@
"\n",
" # Perform template matching\n",
" max_tmpl_lines, max_scene_lines = 4, 10 # Combinatory search parameters (the higer the better but exp slower).\n",
" depth = 30 # The [0, pi] discretization, the higher, the most precise but lin slower.\n",
" scene_padding = 1.0 # A ratio to pad the scene images used in the FDCM algorithm, use if best match may appear on image boundaries.\n",
" depth = 30 # The [0, pi] discretization.\n",
" coeff = 5.0 # A weighting factor to enhance the angular cost vs distance cost in FDCM algorithm.\n",
" scene_padding = 1.0 # A ratio to pad the scene images used in the FDCM algorithm, use if best match may appear on image boundaries.\n",
" distance_type = openfdcm.distance.L2 # or openfdcm.distance.L2_SQUARED or openfdcm.distance.L1\n",
" #num_threads = 4\n",
"\n",
" threadpool = openfdcm.ThreadPool() # could pass num_threads here, but default is optimal\n",
" featuremap_params = openfdcm.Dt3CpuParameters(depth, coeff, scene_padding)\n",
" featuremap_params = openfdcm.Dt3CpuParameters(depth, coeff, scene_padding, distance_type)\n",
" search_strategy = openfdcm.DefaultSearch(max_tmpl_lines, max_scene_lines)\n",
" optimizer_strategy = openfdcm.BatchOptimize(10, threadpool)\n",
" matcher = openfdcm.DefaultMatch()\n",
Expand Down

0 comments on commit 9f13d68

Please sign in to comment.