22#include <onnxruntime_cxx_api.h>
23#include <opencv2/opencv.hpp>
24#include <ovxlib/vsi_nn_pub.h>
41 "clip-vit-base-patch32_ggml-model-q8_0.gguf", ParamCateg);
44 "to process CLIP text embeddings, or empty to just use the raw "
45 "CLIP embeddings. If path is relative, it "
60 public Parameter<yolojevois::clipmodel, yolojevois::textmodel>
64 YOLOjevois(std::string
const & instance, std::map<int, std::string> & labels);
69 void setup(
size_t nclass,
GUIhelper * helper, std::shared_ptr<jevois::dnn::Network> net);
87 void update(
size_t const classnum, std::string
const & label);
90 void update(
size_t const classnum, cv::Mat
const & img);
95 cv::Mat
const &
image(
size_t const classid)
const;
109 void updateMainNetwork();
110 std::atomic<bool> itsLoading =
false;
111 std::atomic<bool> itsLoaded =
false;
112 std::future<void> itsLoadFut;
#define JEVOIS_SHARE_PATH
Base path for shared files (e.g., neural network weights, etc)
A component of a model hierarchy.
Helper class to assist modules in creating graphical and GUI elements.
Helper class for runtime-configurable, quantized open-vocabulary object detection.
std::shared_ptr< jevois::dnn::Network > itsNetwork
Pointer to the main YOLO to update its extra inputs.
std::vector< cv::Mat > itsCLIPimages
void setup(size_t nclass, GUIhelper *helper, std::shared_ptr< jevois::dnn::Network > net)
void update(size_t const classnum, std::string const &label)
Update one class using text.
std::map< int, std::string > & itsLabels
int textEmbeddingSize()
Get CLIP text embedding size, or 0 if we do not have a CLIP text encoder.
void freeze(bool doit)
Freeze/unfreeze parameters that users should not change while running.
std::shared_ptr< Network > itsAuxNet
Optional aux network to process CLIP embeddings.
virtual ~YOLOjevois()
Virtual destructor.
bool ready()
Are we ready to work, or still loading our networks?
std::shared_ptr< CLIP > itsCLIP
CLIP network to get embeddings from text or image queries.
int imageEmbeddingSize()
Get CLIP image embedding size, or 0 if we do not have a CLIP image encoder.
cv::Mat const & image(size_t const classid) const
Access our class definition images.
void load()
Load CLIP and ONNX networks, in a non-blocking thread.
JEVOIS_DECLARE_PARAMETER(clipmodel, std::string, "Path to ggml CLIP model to use, in gguf " "format. If path is relative, it is within " JEVOIS_SHARE_PATH "/clip/", "clip-vit-base-patch32_ggml-model-q8_0.gguf", ParamCateg)
Main namespace for all JeVois classes and functions.
A category to which multiple ParameterDef definitions can belong.