def from_instances(instances: Instances):
        """
        Create scripted Instances from original Instances
        """
        fields = instances.get_fields()
        image_size = instances.image_size
        ret = newInstances(image_size)
        for name, val in fields.items():
            assert hasattr(ret, f"_{name}"), f"No attribute named {name} in {cls_name}"
            setattr(ret, name, deepcopy(val))
        return ret

        Create scripted Instances from original Instances
        
video_chat_text/video_chat_with_StableLM/models/grit_src/third_party/CenterNet2/detectron2/export/torchscript_patch.py