@@ -228,7 +228,7 @@ JsonValue LabelImages::to_json() const{
228228 // m_annotation_file_path
229229 if (m_annotation_file_path.size () > 0 && !m_fail_to_load_annotation_file){
230230 JsonArray anno_json_arr;
231- for (const auto & anno_obj: m_annotated_objects ){
231+ for (const auto & anno_obj: m_annotations ){
232232 anno_json_arr.push_back (object_annotation_to_json (anno_obj));
233233 }
234234 cout << " Saving annotation to " << m_annotation_file_path << endl;
@@ -284,7 +284,7 @@ void LabelImages::load_image_related_data(const std::string& image_path, size_t
284284 for (size_t i = 0 ; i < json_array->size (); i++){
285285 try {
286286 ObjectAnnotation anno_obj = json_to_object_annotation ((*json_array)[i]);
287- m_annotated_objects .emplace_back (std::move (anno_obj));
287+ m_annotations .emplace_back (std::move (anno_obj));
288288 } catch (JsonParseException&){
289289 m_fail_to_load_annotation_file = true ;
290290 QMessageBox box;
@@ -296,16 +296,16 @@ void LabelImages::load_image_related_data(const std::string& image_path, size_t
296296 );
297297 }
298298 }
299- m_last_object_idx = m_annotated_objects .size ();
299+ m_last_object_idx = m_annotations .size ();
300300 cout << " Loaded existing annotation file " << m_annotation_file_path << endl;
301301}
302302
303303void LabelImages::update_rendered_objects (VideoOverlaySet& overlay_set){
304304 overlay_set.clear ();
305305 overlay_set.add (COLOR_RED, {X, Y, WIDTH, HEIGHT});
306306
307- for (size_t i_obj = 0 ; i_obj < m_annotated_objects .size (); i_obj++){
308- const auto & obj = m_annotated_objects [i_obj];
307+ for (size_t i_obj = 0 ; i_obj < m_annotations .size (); i_obj++){
308+ const auto & obj = m_annotations [i_obj];
309309 // overlayset.add(COLOR_RED, pixelbox_to_floatbox(source_image_width, source_image_height, obj.user_box));
310310 const auto mask_float_box = pixelbox_to_floatbox (source_image_width, source_image_height, obj.mask_box );
311311 std::string label = obj.label ;
@@ -400,8 +400,8 @@ void LabelImages::compute_mask(VideoOverlaySet& overlay_set){
400400 }
401401
402402 annotation.label = label;
403- m_last_object_idx = m_annotated_objects .size ();
404- m_annotated_objects .emplace_back (std::move (annotation));
403+ m_last_object_idx = m_annotations .size ();
404+ m_annotations .emplace_back (std::move (annotation));
405405
406406 update_rendered_objects (overlay_set);
407407 }
@@ -444,11 +444,11 @@ LabelImages_Widget::LabelImages_Widget(
444444 scroll_layout->addWidget (button);
445445 connect (button, &QPushButton::clicked, this , [this ](bool ){
446446 auto & program = this ->m_program ;
447- if (program.m_annotated_objects .size () > 0 ){
448- program.m_annotated_objects .pop_back ();
447+ if (program.m_annotations .size () > 0 ){
448+ program.m_annotations .pop_back ();
449449 }
450- if (program.m_annotated_objects .size () > 0 ){
451- program.m_last_object_idx = program.m_annotated_objects .size () - 1 ;
450+ if (program.m_annotations .size () > 0 ){
451+ program.m_last_object_idx = program.m_annotations .size () - 1 ;
452452 }
453453 program.update_rendered_objects (this ->m_overlay_set );
454454 });
@@ -470,8 +470,8 @@ LabelImages_Widget::LabelImages_Widget(
470470}
471471
472472void LabelImages_Widget::on_config_value_changed (void * object){
473- if (m_program.m_annotated_objects .size () > 0 && m_program.m_last_object_idx < m_program.m_annotated_objects .size ()){
474- std::string& cur_label = m_program.m_annotated_objects [m_program.m_last_object_idx ].label ;
473+ if (m_program.m_annotations .size () > 0 && m_program.m_last_object_idx < m_program.m_annotations .size ()){
474+ std::string& cur_label = m_program.m_annotations [m_program.m_last_object_idx ].label ;
475475 cur_label = m_program.FORM_LABEL .slug ();
476476 m_program.update_rendered_objects (m_overlay_set);
477477 }
0 commit comments