Skip to content

Commit

Permalink
Read agglomeration threshold directly from the parameter file
Browse files Browse the repository at this point in the history
  • Loading branch information
ranlu committed Jun 1, 2024
1 parent de122b7 commit 21cad7a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions scripts/atomic_chunk_me.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ try touch ns.data
try touch ongoing_semantic_labels.data

if [ "$OVERLAP" = "1" ]; then
try taskset -c $cpuid $BIN_PATH/agg_nonoverlap $AGG_THRESHOLD input_rg.data frozen.data ns.data
try taskset -c $cpuid $BIN_PATH/agg_nonoverlap $PARAM_JSON input_rg.data frozen.data ns.data
else
try taskset -c $cpuid $BIN_PATH/agg $AGG_THRESHOLD input_rg.data frozen.data ns.data
try taskset -c $cpuid $BIN_PATH/agg $PARAM_JSON input_rg.data frozen.data ns.data
fi

try cat remap.data >> localmap.data
Expand Down
6 changes: 3 additions & 3 deletions scripts/composite_chunk_me.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ do
done

if [ "$OVERLAP" = "2" ]; then
try $BIN_PATH/agg_overlap $AGG_THRESHOLD input_rg.data frozen.data ongoing_supervoxel_counts.data
try $BIN_PATH/agg_overlap $PARAM_JSON input_rg.data frozen.data ongoing_supervoxel_counts.data
elif [ "$OVERLAP" = "1" ]; then
try $BIN_PATH/agg_nonoverlap $AGG_THRESHOLD input_rg.data frozen.data ongoing_supervoxel_counts.data
try $BIN_PATH/agg_nonoverlap $PARAM_JSON input_rg.data frozen.data ongoing_supervoxel_counts.data
else
try $BIN_PATH/agg $AGG_THRESHOLD input_rg.data frozen.data ongoing_supervoxel_counts.data
try $BIN_PATH/agg $PARAM_JSON input_rg.data frozen.data ongoing_supervoxel_counts.data
fi

try cat remap.data >> localmap.data
Expand Down
2 changes: 1 addition & 1 deletion scripts/overlap_chunk_me.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ do
cat boundary_"$i"_"$output_chunk".data >> frozen.data
done

try $BIN_PATH/agg_extra $AGG_THRESHOLD input_rg.data frozen.data ongoing_supervoxel_counts.data
try $BIN_PATH/agg_extra $PARAM_JSON input_rg.data frozen.data ongoing_supervoxel_counts.data

try rm boundary_*.data
try rm incomplete_*.data
Expand Down
9 changes: 7 additions & 2 deletions src/agg/mean_aggl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@
#include <future>
#include <omp.h>
#include <sys/stat.h>
#include <nlohmann/json.hpp>

#include "../seg/SemExtractor.hpp"
#include "../seg/RemapTable.hpp"

#include "edges.h"

using json = nlohmann::json;

static const size_t frozen = (1UL<<(std::numeric_limits<std::size_t>::digits-2));
static const size_t boundary = (1UL<<(std::numeric_limits<std::size_t>::digits-1))|frozen;

Expand Down Expand Up @@ -1145,8 +1148,10 @@ inline void agglomerate(const char * rg_filename, const char * fs_filename, cons
int main(int argc, char *argv[])
{
agglomeration_param_t params;
aff_t th = atof(argv[1]);
params.input_aff_threshold = th;
std::ifstream f(argv[1]);
json conf = json::parse(f);
f.close();
params.input_aff_threshold = atof(conf["AGG_THRESHOLD"]);

std::cout << "agglomerate" << std::endl;
#ifdef MST_EDGE
Expand Down

0 comments on commit 21cad7a

Please sign in to comment.