Hello,
I is use Libtorch for process image, OpenCV very large so try avoid.
This i try make use:

  
      github.com
  
  
    prabhuomkar/pytorch-cpp/blob/master/utils/image_io/src/image_io.cpp
// Copyright 2020-present pytorch-cpp Authors
#include "image_io.h"
#include <torch/torch.h>

#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"

#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"

#define STB_IMAGE_RESIZE_IMPLEMENTATION
#include "stb_image_resize.h"

namespace image_io {
namespace {
    void norm_ip(torch::Tensor img, double min, double max) {
        img.clamp_(min, max);
        img.sub_(min).div_(max - min + 1e-5);
    }



  This file has been truncated. show original

  
  
    
    
  
  


Not able to convert torch::Tensor to juce::image.
I want to read a Video file, split into images on the fly and apply Deep Learning algorithm on image in Libtorch, then turn it back to image JUCE can understand. Anyone is have example make like this?
See also:

  
      
      JUCE – 1 Sep 20
  
  
    

Convert Libtorch torch::Tensor to juce::image and like back 6

Really help is needed. I have this, first to oepncv  and then to juce::image (still crash). Any better way?  cv::Mat toOpenCV(at::Tensor out_tensor, int h, int w, int c) {           out_tensor = out_tensor.squeeze().permute({1, 2, 0});   cout...


  
  
    
    
  
  


Thanks you,