ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
reusex::vision::IDataset Class Referenceabstract

#include <IDataset.hpp>

Inheritance diagram for reusex::vision::IDataset:
Collaboration diagram for reusex::vision::IDataset:

Public Types

using Pair = std::pair<std::unique_ptr<IData>, size_t>

Public Member Functions

 IDataset (std::shared_ptr< ProjectDB > database)
 IDataset (std::filesystem::path dbPath)
virtual ~IDataset ()=default
size_t size () const
int node_id (const std::size_t index) const
size_t filter_annotated ()
 Remove already-annotated frames from the dataset.
size_t filter_annotated_prefix ()
 Remove only the leading contiguous run of already-annotated frames.
virtual Pair get (const std::size_t index) const =0
virtual bool save (const std::span< Pair > &data)=0
void set_confidence (float confidence)
void set_prompts (std::vector< std::string > prompts)

Protected Member Functions

cv::Mat image (const std::size_t index) const
bool save_image (const std::size_t index, const cv::Mat &image)
std::shared_ptr< ProjectDBdatabase () const

Protected Attributes

float confidence_ = 0.5f
 Detection confidence threshold for get().
std::vector< std::string > prompts_
 Concept prompts for get() (empty=default).

Detailed Description

Definition at line 36 of file IDataset.hpp.

Member Typedef Documentation

◆ Pair

using reusex::vision::IDataset::Pair = std::pair<std::unique_ptr<IData>, size_t>

Definition at line 44 of file IDataset.hpp.

Constructor & Destructor Documentation

◆ IDataset() [1/2]

reusex::vision::IDataset::IDataset ( std::shared_ptr< ProjectDB > database)
explicit

References database().

◆ IDataset() [2/2]

reusex::vision::IDataset::IDataset ( std::filesystem::path dbPath)
explicit

◆ ~IDataset()

virtual reusex::vision::IDataset::~IDataset ( )
virtualdefault

Member Function Documentation

◆ database()

std::shared_ptr< ProjectDB > reusex::vision::IDataset::database ( ) const
protected

Referenced by IDataset().

◆ filter_annotated()

size_t reusex::vision::IDataset::filter_annotated ( )

Remove already-annotated frames from the dataset.

Queries the database for frames that already have segmentation images and removes them from this dataset's ID list so they won't be processed.

Returns
Number of frames removed

◆ filter_annotated_prefix()

size_t reusex::vision::IDataset::filter_annotated_prefix ( )

Remove only the leading contiguous run of already-annotated frames.

Unlike filter_annotated(), which drops every already-annotated frame regardless of position, this removes only the maximal prefix of the ordered id list whose frames all already have segmentation images, stopping at the first unannotated frame. This is the correct resume behaviour for the stateful video-tracker path: dropping mid-sequence frames would leave gaps in the temporal memory bank, so we skip only the already-completed prefix and re-process everything from the first gap onward (rebuilding memory from that boundary). For the stateless default path it degrades gracefully to the same "skip completed leading frames" behaviour.

Returns
Number of leading frames removed

◆ get()

virtual Pair reusex::vision::IDataset::get ( const std::size_t index) const
pure virtual

◆ image()

cv::Mat reusex::vision::IDataset::image ( const std::size_t index) const
protected

Referenced by save_image().

◆ node_id()

int reusex::vision::IDataset::node_id ( const std::size_t index) const

◆ save()

virtual bool reusex::vision::IDataset::save ( const std::span< Pair > & data)
pure virtual

◆ save_image()

bool reusex::vision::IDataset::save_image ( const std::size_t index,
const cv::Mat & image )
protected

References image().

◆ set_confidence()

void reusex::vision::IDataset::set_confidence ( float confidence)
inline

Definition at line 152 of file IDataset.hpp.

References confidence_.

◆ set_prompts()

void reusex::vision::IDataset::set_prompts ( std::vector< std::string > prompts)
inline

Definition at line 158 of file IDataset.hpp.

References prompts_.

◆ size()

size_t reusex::vision::IDataset::size ( ) const

Member Data Documentation

◆ confidence_

float reusex::vision::IDataset::confidence_ = 0.5f
protected

Detection confidence threshold for get().

Definition at line 163 of file IDataset.hpp.

Referenced by set_confidence().

◆ prompts_

std::vector<std::string> reusex::vision::IDataset::prompts_
protected

Concept prompts for get() (empty=default).

Definition at line 165 of file IDataset.hpp.

Referenced by set_prompts().


The documentation for this class was generated from the following file: