ui/ImageView.py
def handle_new_box(self, box: SourceBoundingBox):
        """
        Create a new box, creating new observation if needed
        :param box: Source bounding box
        :return: None
        """
        uuid = self.observation_uuid
        if not uuid:  # Imaged moment selected
            new_concept = self.prompt_concept()
            if not new_concept:  # No concept was specified
                return
            observation = self.make_new_observation(new_concept)
            box.set_label(new_concept)
            uuid = observation['observation_uuid']

        box.observation_uuid = uuid
        self.draw_bounding_box(box, self.observation_map[uuid].metadata['box_manager'])
        self.observation_map[uuid].metadata['boxes'].append(box)
        response_json = create_box(box.get_json(), uuid, to_concept=box.part)
        box.association_uuid = response_json['uuid']
        update_imaged_moment_entry(self.moment)

        Create a new box, creating new observation if needed
        :param box: Source bounding box
        :return: None
        
Create a new box, creating new observation if needed
Create a new box creating new observation if needed
def handle_new_box(self, box: SourceBoundingBox):
        uuid = self.observation_uuid
        if not uuid:  
            new_concept = self.prompt_concept()
            if not new_concept:  
                return
            observation = self.make_new_observation(new_concept)
            box.set_label(new_concept)
            uuid = observation['observation_uuid']
        box.observation_uuid = uuid
        self.draw_bounding_box(box, self.observation_map[uuid].metadata['box_manager'])
        self.observation_map[uuid].metadata['boxes'].append(box)
        response_json = create_box(box.get_json(), uuid, to_concept=box.part)
        box.association_uuid = response_json['uuid']
        update_imaged_moment_entry(self.moment)
def handle_new_box ( self , box : SourceBoundingBox ) : uuid = self . observation_uuid if not uuid : new_concept = self . prompt_concept ( ) if not new_concept : return observation = self . make_new_observation ( new_concept ) box . set_label ( new_concept ) uuid = observation [ 'observation_uuid' ] box . observation_uuid = uuid self . draw_bounding_box ( box , self . observation_map [ uuid ] . metadata [ 'box_manager' ] ) self . observation_map [ uuid ] . metadata [ 'boxes' ] . append ( box ) response_json = create_box ( box . get_json ( ) , uuid , to_concept = box . part ) box . association_uuid = response_json [ 'uuid' ] update_imaged_moment_entry ( self . moment )
Create a new box, creating new observation if needed
Create a new box creating new observation if needed
"""
        Create a new box, creating new observation if needed
        :param box: Source bounding box
        :return: None
        """ # Imaged moment selected # No concept was specified
None
self
box
SourceBoundingBox
Source bounding box
Source bounding box