> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encord.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Objects.spaces.image space

## ImageSpace Objects

```python theme={"dark"}
class ImageSpace(Space[_GeometricObjectAnnotation,
                       _GlobalClassificationAnnotation, FrameOverlapStrategy])
```

Image space implementation for single-frame image annotations.

#### put\_object\_instance

```python theme={"dark"}
def put_object_instance(object_instance: ObjectInstance,
                        coordinates: Union[GeometricCoordinates, str],
                        *,
                        on_overlap: FrameOverlapStrategy = "error",
                        created_at: Optional[datetime] = None,
                        created_by: Optional[str] = None,
                        last_edited_at: Optional[datetime] = None,
                        last_edited_by: Optional[str] = None,
                        confidence: Optional[float] = None,
                        manual_annotation: Optional[bool] = None) -> None
```

Add an object instance to the image space.

**Arguments**:

* `object_instance` - The object instance to add to the image space.
* `coordinates` - Geometric coordinates for the object (e.g., bounding box, polygon, polyline),
  or an Encord-compatible RLE string for bitmask objects.
  Use `encord.common.bitmask_operations.coco_rle_to_encord_rle` before passing
  pycocotools/COCO RLE counts here.
* `on_overlap` - Strategy for handling existing annotations.
  * "error" (default): Raises an error if annotation already exists.
  * "replace": Overwrites existing annotations.
* `created_at` - Optional timestamp when the annotation was created.
* `created_by` - Optional identifier of who created the annotation.
* `last_edited_at` - Optional timestamp when the annotation was last edited.
* `last_edited_by` - Optional identifier of who last edited the annotation.
* `confidence` - Optional confidence score for the annotation (0.0 to 1.0).
* `manual_annotation` - Optional flag indicating if this was manually annotated.

**Raises**:

* `LabelRowError` - If annotation already exists when on\_overlap="error".

#### put\_classification\_instance

```python theme={"dark"}
def put_classification_instance(
        classification_instance: ClassificationInstance,
        *,
        on_overlap: Optional[FrameOverlapStrategy] = "error",
        created_at: Optional[datetime] = None,
        created_by: Optional[str] = None,
        last_edited_at: Optional[datetime] = None,
        last_edited_by: Optional[str] = None,
        confidence: Optional[float] = None,
        manual_annotation: Optional[bool] = None) -> None
```

Add a classification instance to the image space.

**Arguments**:

* `classification_instance` - The classification instance to add to the image space.
* `on_overlap` - Strategy for handling existing classifications.
  * "error" (default): Raises an error if classification of the same ontology item already exists.
  * "replace": Overwrites existing classifications.
* `created_at` - Optional timestamp when the annotation was created.
* `created_by` - Optional identifier of who created the annotation.
* `last_edited_at` - Optional timestamp when the annotation was last edited.
* `last_edited_by` - Optional identifier of who last edited the annotation.
* `confidence` - Optional confidence score for the annotation (0.0 to 1.0).
* `manual_annotation` - Optional flag indicating if this was manually annotated.

**Raises**:

* `LabelRowError` - If classification already exists when on\_overlap="error".

#### remove\_object\_instance

```python theme={"dark"}
def remove_object_instance(object_hash: str) -> Optional[ObjectInstance]
```

Remove an object instance from the image space.

This removes the object and all associated data from the image space.

**Arguments**:

* `object_hash` - The hash identifier of the object instance to remove.

**Returns**:

* `Optional[ObjectInstance]` - The removed object instance, or None if the object wasn't found.

#### remove\_classification\_instance

```python theme={"dark"}
def remove_classification_instance(
        classification_hash: str) -> Optional[ClassificationInstance]
```

Remove a classification instance from the image space.

This removes the classification and all associated data from the image space.

**Arguments**:

* `classification_hash` - The hash identifier of the classification instance to remove.

**Returns**:

* `Optional[ClassificationInstance]` - The removed classification instance, or None if the classification wasn't found.
