From 9732bae6765672104cc6ffc6c08671588cb990b3 Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Fri, 23 Aug 2024 16:50:30 -0400 Subject: [PATCH] Remove non-essential packages from openglgt: removed progress bars, colormap visualizers, unused fast_obj package --- .gitmodules | 9 -- infinigen/datagen/customgt/CMakeLists.txt | 7 +- .../datagen/customgt/dependencies/fast_obj | 1 - .../datagen/customgt/dependencies/indicators | 1 - .../scharstein_flow_viz/README.txt | 40 ------- .../scharstein_flow_viz/colorcode.cpp | 76 ------------ .../scharstein_flow_viz/colorcode.h | 4 - .../customgt/dependencies/tinycolormap | 1 - infinigen/datagen/customgt/io.cpp | 2 +- infinigen/datagen/customgt/io.hpp | 3 - .../datagen/customgt/load_blender_mesh.cpp | 21 +--- infinigen/datagen/customgt/main.cpp | 30 +---- infinigen/datagen/customgt/utils.cpp | 113 +----------------- infinigen/datagen/customgt/utils.hpp | 15 +-- 14 files changed, 15 insertions(+), 308 deletions(-) delete mode 160000 infinigen/datagen/customgt/dependencies/fast_obj delete mode 160000 infinigen/datagen/customgt/dependencies/indicators delete mode 100644 infinigen/datagen/customgt/dependencies/scharstein_flow_viz/README.txt delete mode 100644 infinigen/datagen/customgt/dependencies/scharstein_flow_viz/colorcode.cpp delete mode 100644 infinigen/datagen/customgt/dependencies/scharstein_flow_viz/colorcode.h delete mode 160000 infinigen/datagen/customgt/dependencies/tinycolormap diff --git a/.gitmodules b/.gitmodules index 1534b356f..d6b7f095b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,18 +10,9 @@ [submodule "infinigen/datagen/customgt/dependencies/cnpy"] path = infinigen/datagen/customgt/dependencies/cnpy url = https://github.com/rogersce/cnpy.git -[submodule "infinigen/datagen/customgt/dependencies/indicators"] - path = infinigen/datagen/customgt/dependencies/indicators - url = https://github.com/p-ranav/indicators.git -[submodule "infinigen/datagen/customgt/dependencies/tinycolormap"] - path = infinigen/datagen/customgt/dependencies/tinycolormap - url = https://github.com/yuki-koyama/tinycolormap.git [submodule "infinigen/datagen/customgt/dependencies/glm"] path = infinigen/datagen/customgt/dependencies/glm url = https://github.com/g-truc/glm.git -[submodule "infinigen/datagen/customgt/dependencies/fast_obj"] - path = infinigen/datagen/customgt/dependencies/fast_obj - url = https://github.com/thisistherk/fast_obj.git [submodule "infinigen/datagen/customgt/dependencies/json"] path = infinigen/datagen/customgt/dependencies/json url = https://github.com/nlohmann/json.git diff --git a/infinigen/datagen/customgt/CMakeLists.txt b/infinigen/datagen/customgt/CMakeLists.txt index c14932ba0..3045376db 100644 --- a/infinigen/datagen/customgt/CMakeLists.txt +++ b/infinigen/datagen/customgt/CMakeLists.txt @@ -9,18 +9,13 @@ add_definitions(-D GLM_ENABLE_EXPERIMENTAL) add_definitions(-D PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}) include_directories(/usr/include/) # on linux include_directories(dependencies) # for cnpy -include_directories(dependencies/indicators/include) include_directories(dependencies/argparse/include) include_directories(dependencies/eigen) -include_directories(dependencies/tinycolormap/include) include_directories(dependencies/glm) include_directories(dependencies/json/single_include) include_directories(dependencies/glad/include) -include_directories(dependencies/scharstein_flow_viz) add_subdirectory(dependencies/cnpy) -add_subdirectory(dependencies/fast_obj) -add_subdirectory(dependencies/tinycolormap) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -49,7 +44,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") link_libraries(stdc++fs) endif() -add_executable(customgt ${ADJACENT_SRC_FILES} dependencies/scharstein_flow_viz/colorcode.cpp dependencies/fast_obj/fast_obj.h dependencies/fast_obj/fast_obj.c dependencies/glad/src/glad.c dependencies/glad/src/glad_egl.c) +add_executable(customgt ${ADJACENT_SRC_FILES} dependencies/glad/src/glad.c dependencies/glad/src/glad_egl.c) set_property(TARGET customgt PROPERTY CXX_STANDARD 17) diff --git a/infinigen/datagen/customgt/dependencies/fast_obj b/infinigen/datagen/customgt/dependencies/fast_obj deleted file mode 160000 index 85778da5f..000000000 --- a/infinigen/datagen/customgt/dependencies/fast_obj +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 85778da5fc320b7e52885f8e869edc079695cc79 diff --git a/infinigen/datagen/customgt/dependencies/indicators b/infinigen/datagen/customgt/dependencies/indicators deleted file mode 160000 index a5bc05f32..000000000 --- a/infinigen/datagen/customgt/dependencies/indicators +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a5bc05f32a9c719535054b7fa5306ce5c8d055d8 diff --git a/infinigen/datagen/customgt/dependencies/scharstein_flow_viz/README.txt b/infinigen/datagen/customgt/dependencies/scharstein_flow_viz/README.txt deleted file mode 100644 index 33812c788..000000000 --- a/infinigen/datagen/customgt/dependencies/scharstein_flow_viz/README.txt +++ /dev/null @@ -1,40 +0,0 @@ -Some utilities for reading, writing, and color-coding .flo images - -Daniel Scharstein, 7/2/07 -updated 2/9/08 to fix bug in color_flow.cpp -updated 6/9/09 to make robust to NaN or constant 0 flow (thanks Jan Bouecke) - -See flowIO.cpp for sample code for reading and writing .flo files. -Here's an excerpt from this file describing the flow file format: - -// ".flo" file format used for optical flow evaluation -// -// Stores 2-band float image for horizontal (u) and vertical (v) flow components. -// Floats are stored in little-endian order. -// A flow value is considered "unknown" if either |u| or |v| is greater than 1e9. -// -// bytes contents -// -// 0-3 tag: "PIEH" in ASCII, which in little endian happens to be the float 202021.25 -// (just a sanity check that floats are represented correctly) -// 4-7 width as an integer -// 8-11 height as an integer -// 12-end data (width*height*2*4 bytes total) -// the float values for u and v, interleaved, in row order, i.e., -// u[row0,col0], v[row0,col0], u[row0,col1], v[row0,col1], ... -// - - -Once you have a .flo file, you can create a color coding of it using -color_flow - -Use colortest to visualize the encoding - - -To compile - -cd imageLib -make -cd .. -make -./colortest 10 colors.png diff --git a/infinigen/datagen/customgt/dependencies/scharstein_flow_viz/colorcode.cpp b/infinigen/datagen/customgt/dependencies/scharstein_flow_viz/colorcode.cpp deleted file mode 100644 index 89f4d08f7..000000000 --- a/infinigen/datagen/customgt/dependencies/scharstein_flow_viz/colorcode.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// colorcode.cpp -// -// Color encoding of flow vectors -// adapted from the color circle idea described at -// http://members.shaw.ca/quadibloc/other/colint.htm -// -// Daniel Scharstein, 4/2007 -// added tick marks and out-of-range coding 6/05/07 - -#include -#include -typedef unsigned char uchar; - -int ncols = 0; -#define MAXCOLS 60 -int colorwheel[MAXCOLS][3]; - - -void setcols(int r, int g, int b, int k) -{ - colorwheel[k][0] = r; - colorwheel[k][1] = g; - colorwheel[k][2] = b; -} - -void makecolorwheel() -{ - // relative lengths of color transitions: - // these are chosen based on perceptual similarity - // (e.g. one can distinguish more shades between red and yellow - // than between yellow and green) - int RY = 15; - int YG = 6; - int GC = 4; - int CB = 11; - int BM = 13; - int MR = 6; - ncols = RY + YG + GC + CB + BM + MR; - //printf("ncols = %d\n", ncols); - if (ncols > MAXCOLS) - exit(1); - int i; - int k = 0; - for (i = 0; i < RY; i++) setcols(255, 255*i/RY, 0, k++); - for (i = 0; i < YG; i++) setcols(255-255*i/YG, 255, 0, k++); - for (i = 0; i < GC; i++) setcols(0, 255, 255*i/GC, k++); - for (i = 0; i < CB; i++) setcols(0, 255-255*i/CB, 255, k++); - for (i = 0; i < BM; i++) setcols(255*i/BM, 0, 255, k++); - for (i = 0; i < MR; i++) setcols(255, 0, 255-255*i/MR, k++); -} - -void computeColor(float fx, float fy, uchar *pix) -{ - if (ncols == 0) - makecolorwheel(); - - float rad = sqrt(fx * fx + fy * fy); - rad = fminf(rad, 0.999); // Added by Lahav - - float a = atan2(-fy, -fx) / M_PI; - float fk = (a + 1.0) / 2.0 * (ncols-1); - int k0 = (int)fk; - int k1 = (k0 + 1) % ncols; - float f = fk - k0; - //f = 0; // uncomment to see original color wheel - for (int b = 0; b < 3; b++) { - float col0 = colorwheel[k0][b] / 255.0; - float col1 = colorwheel[k1][b] / 255.0; - float col = (1 - f) * col0 + f * col1; - if (rad <= 1) - col = 1 - rad * (1 - col); // increase saturation with radius - else - col *= .75; // out of range - pix[2 - b] = (int)(255.0 * col); - } -} diff --git a/infinigen/datagen/customgt/dependencies/scharstein_flow_viz/colorcode.h b/infinigen/datagen/customgt/dependencies/scharstein_flow_viz/colorcode.h deleted file mode 100644 index ee99b6b5b..000000000 --- a/infinigen/datagen/customgt/dependencies/scharstein_flow_viz/colorcode.h +++ /dev/null @@ -1,4 +0,0 @@ - -typedef unsigned char uchar; - -void computeColor(float fx, float fy, uchar *pix); diff --git a/infinigen/datagen/customgt/dependencies/tinycolormap b/infinigen/datagen/customgt/dependencies/tinycolormap deleted file mode 160000 index 67198d2b2..000000000 --- a/infinigen/datagen/customgt/dependencies/tinycolormap +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 67198d2b2b48ca5e97600c83b5c0f2310cfd4c03 diff --git a/infinigen/datagen/customgt/io.cpp b/infinigen/datagen/customgt/io.cpp index 68650e607..e2d28fc80 100644 --- a/infinigen/datagen/customgt/io.cpp +++ b/infinigen/datagen/customgt/io.cpp @@ -13,7 +13,7 @@ #include "io.hpp" #include "utils.hpp" #include "cnpy/cnpy.h" -#include "colorcode.h" + #define STB_IMAGE_WRITE_IMPLEMENTATION #include "stb/stb_image_write.h" diff --git a/infinigen/datagen/customgt/io.hpp b/infinigen/datagen/customgt/io.hpp index 2fa330557..5a4ed68a4 100644 --- a/infinigen/datagen/customgt/io.hpp +++ b/infinigen/datagen/customgt/io.hpp @@ -11,9 +11,6 @@ #include #include #include -#include -typedef tinycolormap::ColormapType clrmap; -#include #include "cnpy/cnpy.h" #include diff --git a/infinigen/datagen/customgt/load_blender_mesh.cpp b/infinigen/datagen/customgt/load_blender_mesh.cpp index e0be834fb..84dcedec2 100644 --- a/infinigen/datagen/customgt/load_blender_mesh.cpp +++ b/infinigen/datagen/customgt/load_blender_mesh.cpp @@ -6,18 +6,16 @@ #include #include -#include //without .h -#include +#include #include #include #include + #include "string_tools.hpp" #include "load_blender_mesh.hpp" #include "buffer_arrays.hpp" using json = nlohmann::json; -using namespace indicators; -using namespace indicators::option; auto parse_json(const fs::path json_path){ const json data = json::parse(std::ifstream(json_path)); @@ -38,16 +36,6 @@ std::shared_ptr load_blender_mesh(const fs::path src_json_pat // Progress bar static int object_idx = 0; - static ProgressBar bar{ - BarWidth{20}, Start{"["}, End{"]"}, - ShowElapsedTime{true}, ShowRemainingTime{true}, - ForegroundColor{Color::blue}, - FontStyles{std::vector{FontStyle::bold}} - }; - if (object_idx == 0){ - bar.set_option(PrefixText{truncate(std::string("Loading..."), 20)}); - bar.set_progress(0); - } static std::unordered_map npz_lookup; @@ -77,7 +65,8 @@ std::shared_ptr load_blender_mesh(const fs::path src_json_pat const npz ¤t_npz = npz_lookup.at(current_npz_path.string()); current_buf = BufferArrays(current_npz, current_mesh_id, current_obj.type); - bar.set_option(PrefixText{"Loading " + truncate(current_obj.name, 20) + " " + std::to_string(object_idx++) + "/" + std::to_string(info_lookup.size())}); + std::cout << "Loading " << truncate(current_obj.name, 20) << " "; + std::cout << std::to_string(object_idx++) << "/" << std::to_string(info_lookup.size()) << std::endl; if (next_info_lookup.count(current_mesh_id) > 0){ next_obj = next_info_lookup.at(current_mesh_id); @@ -103,7 +92,7 @@ std::shared_ptr load_blender_mesh(const fs::path src_json_pat new_obj = std::shared_ptr(new CurvesBlenderObject(current_buf, next_buf, all_instance_ids, current_obj)); current_buf.remove_instances(all_instance_ids); } - bar.set_progress((object_idx * 100)/info_lookup.size()); + RASSERT((object_idx == info_lookup.size()) == (it == info_lookup.end())); return new_obj; } diff --git a/infinigen/datagen/customgt/main.cpp b/infinigen/datagen/customgt/main.cpp index fb200361d..920ba497d 100644 --- a/infinigen/datagen/customgt/main.cpp +++ b/infinigen/datagen/customgt/main.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include "shader.hpp" #include "blender_object.hpp" @@ -367,11 +366,8 @@ int main(int argc, char *argv[]) { points_3d(o.y, o.x,k) = pixels[o.j+k]; depth(o.y, o.x) = pixels[o.j+2]; } - o.progressbar(); } if (depth_only || !flow_only) { - auto depth_color = to_color_map(depth, 0.0, 0.90); - imwrite(output_dir / ("Depth_" + cd.frame_string + ".png"), depth_color); save_npy(output_dir / ("Depth_" + cd.frame_string + ".npy"), depth); } if (!depth_only) { @@ -387,10 +383,9 @@ int main(int argc, char *argv[]) { for (int k=0; k<3; k++) next_points_3d(o.y, o.x,k) = pixels[o.j+k]; } - o.progressbar(); } flow3d = cd.project(next_points_3d) - cd.project(points_3d); - const auto flow_viz = compute_flow_viz(flow3d); + std::string output_png, output_npy; if (flow_type == FLOW) { output_png = "Flow3D_" + cd.frame_string + ".png"; @@ -409,7 +404,7 @@ int main(int argc, char *argv[]) { output_npy = "InvPointTraj3D_" + cd.frame_string + ".npy"; } else assert(0); - imwrite(output_dir / output_png, flow_viz); + save_npy(output_dir / output_npy, flow3d); } } @@ -424,7 +419,6 @@ int main(int argc, char *argv[]) { for (const loop_obj &o : image_iterator(buffer_width, buffer_height, "Geometry Surface Normals")){ for (int k=0; k<3; k++) geo_normals(o.y/2, o.x/2, k) += pixels[o.j+k]; - o.progressbar(); } Eigen::Tensor geo_normal_color(output_h, output_w, 3); @@ -451,14 +445,8 @@ int main(int argc, char *argv[]) { for (const loop_obj &o : image_iterator(buffer_width, buffer_height, "Copying instance segmentation masks")){ for (int k=0; k<3; k++) instance_seg(o.y, o.x, k) = pixels[o.j + k]; - o.progressbar(); } save_npy(output_dir / ("InstanceSegmentation_" + cd.frame_string + ".npy"), instance_seg); - - Eigen::Tensor instance_seg_2d(buffer_height, buffer_width); - for (const loop_obj &o : image_iterator(buffer_width, buffer_height)) - instance_seg_2d(o.y, o.x) = long(instance_seg(o.y, o.x, 0) % 1000) + 1000 * long(instance_seg(o.y, o.x, 1) % 1000) + 1000000 * long(instance_seg(o.y, o.x, 2) % 1000); - imwrite(output_dir / ("InstanceSegmentation_" + cd.frame_string + ".png"), to_color_map(instance_seg_2d)); } /* @@ -470,10 +458,8 @@ int main(int argc, char *argv[]) { object_seg.setZero(); for (const loop_obj &o : image_iterator(buffer_width, buffer_height, "Copying object segmentation masks")){ object_seg(o.y, o.x) = pixels[o.j]; - o.progressbar(); } save_npy(output_dir / ("ObjectSegmentation_" + cd.frame_string + ".npy"), object_seg); - imwrite(output_dir / ("ObjectSegmentation_" + cd.frame_string + ".png"), to_color_map(object_seg.cast())); } if (!flow_only && !depth_only) { @@ -482,10 +468,8 @@ int main(int argc, char *argv[]) { tag_seg.setZero(); for (const loop_obj &o : image_iterator(buffer_width, buffer_height, "Copying tag segmentation mask")){ tag_seg(o.y, o.x) = pixels[o.j]; - o.progressbar(); } save_npy(output_dir / ("TagSegmentation_" + cd.frame_string + ".npy"), tag_seg); - imwrite(output_dir / ("TagSegmentation_" + cd.frame_string + ".png"), to_color_map(tag_seg.cast())); } @@ -500,7 +484,6 @@ int main(int argc, char *argv[]) { // for (const loop_obj &o : image_iterator(buffer_width, buffer_height, "Copying face ids from first frame")){ // for (int k=0; k<3; k++) // faceids(0, o.y, o.x, k) = pixels[o.j+k]; - // o.progressbar(); // } // } // glBindFramebuffer(GL_FRAMEBUFFER, cd.framebuffer_next_faceids); @@ -509,7 +492,6 @@ int main(int argc, char *argv[]) { // for (const loop_obj &o : image_iterator(buffer_width, buffer_height, "Copying face ids from second frame")){ // for (int k=0; k<3; k++) // faceids(1, o.y, o.x, k) = pixels[o.j+k]; - // o.progressbar(); // } // } // Eigen::Array flow_occlusion(buffer_height, buffer_width); @@ -532,7 +514,6 @@ int main(int argc, char *argv[]) { // } // } // flow_occlusion(o.y, o.x) = ((unsigned char)match_exists) * 255; - // o.progressbar(); // } // imwrite(output_dir / ("Flow3DMask_" + cd.frame_string + ".png"), flow_occlusion); // } @@ -544,10 +525,7 @@ int main(int argc, char *argv[]) { face_size.setZero(); for (const loop_obj &o : image_iterator(buffer_width, buffer_height, "Copying Face-Sizes (in m^2)")){ face_size(o.y/2, o.x/2) = pixels[o.j]/4; - o.progressbar(); } - auto face_size_color = to_color_map(face_size, 0, 0.5, 0); - imwrite(output_dir / ("FaceSizeCM" + cd.frame_string + ".png"), face_size_color); // Reading/Writing the face size in pixels read_buffer(GL_COLOR_ATTACHMENT4, pixels, buffer_width, buffer_height); @@ -555,10 +533,7 @@ int main(int argc, char *argv[]) { pixel_size.setZero(); for (const loop_obj &o : image_iterator(buffer_width, buffer_height, "Copying Face-Sizes (in pixels)")){ pixel_size(o.y/2, o.x/2) = pixels[o.j]/4; - o.progressbar(); } - auto pixel_size_color = to_color_map(pixel_size, 0, 0.5, 0); - imwrite(output_dir / ("FaceSizePX" + cd.frame_string + ".png"), pixel_size_color); */ @@ -573,7 +548,6 @@ int main(int argc, char *argv[]) { occlusion_boundaries.setZero(); for (const loop_obj &o : image_iterator(buffer_width, buffer_height, "Copying Occlusion Boundaries")){ occlusion_boundaries(o.y, o.x) = pixels[o.j+1]*255; - o.progressbar(); } imwrite(output_dir / ("OcclusionBoundaries_" + cd.frame_string + ".png"), occlusion_boundaries); } diff --git a/infinigen/datagen/customgt/utils.cpp b/infinigen/datagen/customgt/utils.cpp index 1206a7141..94f285cf6 100644 --- a/infinigen/datagen/customgt/utils.cpp +++ b/infinigen/datagen/customgt/utils.cpp @@ -11,7 +11,6 @@ #include #include "utils.hpp" #include "cnpy/cnpy.h" -#include "colorcode.h" void release_assert(const char *file, int line, bool condition, const std::string &msg){ if (!condition) @@ -40,17 +39,7 @@ void glCheckError_(const char *file, int line) } const std::vector image_iterator(const int width, const int height, const std::string desc){ - using namespace indicators; - std::shared_ptr bar(new ProgressBar{ - option::BarWidth{20}, - option::Start{"["}, - option::End{"]"}, - option::ShowElapsedTime{true}, - option::ShowRemainingTime{true}, - option::ForegroundColor{Color::blue}, - option::FontStyles{std::vector{FontStyle::bold}}, - option::PrefixText{desc} - }); + const size_t num_elements = width*height; std::vector output; output.reserve(num_elements); @@ -60,7 +49,7 @@ const std::vector image_iterator(const int width, const int height, co for (int x=0; x prev_percent); - output.push_back(loop_obj(x, y, (x+(height-y-1)*width) * 4, should_tick ? bar : nullptr)); + output.push_back(loop_obj(x, y, (x+(height-y-1)*width) * 4)); prev_percent = current_percent; } } @@ -68,100 +57,4 @@ const std::vector image_iterator(const int width, const int height, co assert (num_elements == output.size()); assert (output.back().progbar); return output; -} - -Eigen::Tensor compute_flow_viz(const Eigen::Tensor &input_image){ - const int width = input_image.dimension(1); - const int height = input_image.dimension(0); - const double fac_x = (160.0/2) / width; - const double fac_y = (120.0/2) / height; - Eigen::Tensor output(height, width, 3); - output.setZero(); - - const int LEGEND_SIZE = 0; - - for (int y=0; y to_color_map(const Eigen::Tensor &input_image, const double &min_percentile, const double &max_percentile, const double &minval, const clrmap &type) { - std::vector all_nonzero_values; - const size_t width = input_image.dimension(1); - const size_t height = input_image.dimension(0); - all_nonzero_values.reserve(height*width); - for (int y=0; y minval) && (input_image(y,x) < 1e4)) - all_nonzero_values.push_back(input_image(y,x)); - } - } - std::sort(all_nonzero_values.begin(), all_nonzero_values.end()); - const double N = all_nonzero_values.size(); - const double cur_min = all_nonzero_values[int(N * min_percentile)]; - const double cur_max = all_nonzero_values[int(N * max_percentile) - 1]; - assert (cur_max > cur_min); - Eigen::Tensor output(height, width, 3); - output.setZero(); - for (int y=0; y minval) && (input_image(y,x) < 1e4)){ - const tinycolormap::Color color = tinycolormap::GetColor(value, type); - output(y,x,0) = color.r()*255; - output(y,x,1) = color.g()*255; - output(y,x,2) = color.b()*255; - } - } - } - return output; -} - - -Eigen::Tensor to_color_map(const Eigen::Tensor &input_image) { - std::vector all_nonzero_values; - const size_t width = input_image.dimension(1); - const size_t height = input_image.dimension(0); - Eigen::Tensor output(height, width, 3); - output.setZero(); - std::unordered_map int2double; - for (int y=0; y (rand()) / static_cast (RAND_MAX); - int2double[key] = value; - } - const tinycolormap::Color color = tinycolormap::GetColor(value, clrmap::Turbo); - output(y,x,0) = color.r()*255; - output(y,x,1) = color.g()*255; - output(y,x,2) = color.b()*255; - } - } - return output; -} +} \ No newline at end of file diff --git a/infinigen/datagen/customgt/utils.hpp b/infinigen/datagen/customgt/utils.hpp index aace92bff..a334583bc 100644 --- a/infinigen/datagen/customgt/utils.hpp +++ b/infinigen/datagen/customgt/utils.hpp @@ -11,9 +11,7 @@ #include #include #include -#include -typedef tinycolormap::ColormapType clrmap; -#include + #include "cnpy/cnpy.h" #include @@ -27,16 +25,9 @@ void glCheckError_(const char *file, int line); class loop_obj { public: const int x, y, j; - const std::shared_ptr progbar; - - loop_obj(int xc, int yc, int jc, std::shared_ptr pb) : x(xc), y(yc), j(jc), progbar(pb) {} - void progressbar() const {if (progbar) progbar->tick();} -}; -Eigen::Tensor compute_flow_viz(const Eigen::Tensor &input_image); + loop_obj(int x, int y, int j) : x(x), y(y), j(j) {} -Eigen::Tensor to_color_map(const Eigen::Tensor &input_image, const double &min_percentile, const double &max_percentile, const double &minval=1e-3, const clrmap &type=clrmap::Jet); - -Eigen::Tensor to_color_map(const Eigen::Tensor &input_image); +}; const std::vector image_iterator(const int width, const int height, const std::string desc=""); \ No newline at end of file