diff --git a/scripts/atomic_chunk_me.sh b/scripts/atomic_chunk_me.sh index fb72859..dd98e35 100755 --- a/scripts/atomic_chunk_me.sh +++ b/scripts/atomic_chunk_me.sh @@ -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 diff --git a/scripts/composite_chunk_me.sh b/scripts/composite_chunk_me.sh index 67d9fbf..5658075 100755 --- a/scripts/composite_chunk_me.sh +++ b/scripts/composite_chunk_me.sh @@ -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 diff --git a/scripts/overlap_chunk_me.sh b/scripts/overlap_chunk_me.sh index 9c2dc70..bac68c6 100755 --- a/scripts/overlap_chunk_me.sh +++ b/scripts/overlap_chunk_me.sh @@ -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 diff --git a/src/agg/mean_aggl.cpp b/src/agg/mean_aggl.cpp index 89a1a42..80dad3e 100644 --- a/src/agg/mean_aggl.cpp +++ b/src/agg/mean_aggl.cpp @@ -31,12 +31,15 @@ #include #include #include +#include #include "../seg/SemExtractor.hpp" #include "../seg/RemapTable.hpp" #include "edges.h" +using json = nlohmann::json; + static const size_t frozen = (1UL<<(std::numeric_limits::digits-2)); static const size_t boundary = (1UL<<(std::numeric_limits::digits-1))|frozen; @@ -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