ByteDance-Seed / ByteDance-Seed/Depth-Anything-3

Bug: Logger class missing `warning()` method causes AttributeError

Open
#113 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6.3k
Forks
702
PR merge metrics
No merged PRs in 30d

Description

## Description

The custom `Logger` class in logger.py is missing the `warning()` method, which causes an `AttributeError` when api.py attempts to call it.

## Error Message

```
AttributeError: 'Logger' object has no attribute 'warning'
```

## Stack Trace

```
File "src/depth_anything_3/api.py", line 334, in _align_to_input_extrinsics_intrinsics
logger.warning(
^^^^^^^^^^^^^^
AttributeError: 'Logger' object has no attribute 'warning'
```

## Root Cause

In api.py line 334, the code calls `logger.warning()`:

```python
logger.warning(
"Pose alignment failed due to insufficient camera motion. "
"Using model-estimated poses and relative depth."
)
```

However, the `Logger` class in logger.py only defines `warn()`, not `warning()`:

```python
def warn(self, *args, **kwargs):
self.log("WARN:", *args, **kwargs)
```

## Suggested Fix

Add a `warning()` method as an alias to `warn()` in the `Logger` class to match Python's standard `logging` module interface:

```python
def warning(self, *args, **kwargs):
"""Alias for warn() to match standard logging interface."""
self.warn(*args, **kwargs)
```

## Environment

- Using the inference API with external extrinsics/intrinsics alignment
- Error occurs when pose alignment fails due to insufficient camera motion

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.