text: #include "mediapipe/framework/calculator_framework.h"
  #include "mediapipe/framework/port/logging.h"
  #include "mediapipe/framework/formats/image_frame.h"
  #include "mediapipe/framework/formats/image_frame_opencv.h"
  
  
  
  // #include "mediapipe/gpu/gpu_buffer.h"
  #if !defined(MEDIAPIPE_DISABLE_GPU)
  // #include "mediapipe/gpu/gl_calculator_helper.h"
  // #include "mediapipe/gpu/gl_simple_shaders.h"
  #include "mediapipe/gpu/gpu_buffer.h"
  // #include "mediapipe/gpu/shader_util.h"
  #endif  //  !MEDIAPIPE_DISABLE_GPU
  
  #include "mediapipe/framework/port/opencv_highgui_inc.h"
  #include "mediapipe/framework/port/opencv_imgproc_inc.h"
  #include "mediapipe/framework/port/opencv_video_inc.h"
  
  
  
  // #include "mediapipe/calculators/tflite/tflite_inference_calculator.pb.h"
  
  namespace {
      constexpr char kInputTag[] = "IMAGE";
      constexpr char kOutputTag[] = "IMAGE";
  
  }
  
  
  //only support gpu currently
  namespace mediapipe {
      class CheckImageCalculator : public CalculatorBase
      {
          public:
          CheckImageCalculator(){};
          ~CheckImageCalculator(){};
  
          static ::mediapipe::Status GetContract(CalculatorContract* cc)
          {
  
              // cc->Inputs().Tag("TAG_NAME")->set<CLASS_TYPE>();
              cc->Inputs().Tag(kInputTag).Set<mediapipe::ImageFrame>();
  
              // cc->Outputs().Tag("TAG_NAME")->set<CLASS_TYPE>();
              cc->Outputs().Tag(kOutputTag).Set<mediapipe::ImageFrame>();
  
              return ::mediapipe::OkStatus();
          }
  
          ::mediapipe::Status Open(CalculatorContext *cc)
          {
  
  
              return ::mediapipe::OkStatus();
          }
  
          ::mediapipe::Status Process(CalculatorContext *cc)
          {
              LOG(INFO) << "im here in milad check image calculator";
  
              
  
              // LOG(INFO) << "options " << adad;
  
              if (cc->Inputs().Tag(kInputTag).IsEmpty() ) {
                  LOG(INFO) << "empty image";
                  return mediapipe::OkStatus();
              } else {
                  auto mk = "cvsds";
                  LOG(INFO) << "ihaveit" << mk;
              }
  
              const auto& image = cc->Inputs().Tag(kInputTag).Get<ImageFrame>();
  
              cv::Mat input_mat = formats::MatView(&image);
  
              cv::imwrite("checked.png",input_mat);
              LOG(INFO) << "checked image noc " << input_mat.channels();
              LOG(INFO) << "writed";
  
              // mediapipe::GpuBuffer input_image = cc->Inputs().Tag(kInputTag).Get<mediapipe::GpuBuffer>();
  
              // const auto& input_img = cc->Inputs().Tag(kInputTag).Get<mediapipe::GpuBuffer>();
              // // auto output_img = absl::make_unique<ImageFrame>(
  
              // cc->Outputs().Tag(kOutputTag).Add(input_img.release(), cc->InputTimestamp());
              return ::mediapipe::OkStatus();
          }
  
          ::mediapipe::Status Close(CalculatorContext *cc)
          {
              return ::mediapipe::OkStatus();
          }
      };
      REGISTER_CALCULATOR(CheckImageCalculator);
  }
  