activeloopai / activeloopai/deeplake

[FEATURE]

オープン
#2,178 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
C++
スター
9.2k
フォーク
722
PR マージ指標
30日以内にマージされた PR はありません

説明

## 🚨🚨 Feature Request

- [ ] Related to an existing [Issue](../issues)
- [x] A new implementation (Improvement, Extension)

### Is your feature request related to a problem?

``` python
@deeplake.compute
def resize(sample_in, sample_out, new_size):
## First two arguments are always default arguments containing:
# 1st argument is an element of the input iterable (list, dataset, array,...)
# 2nd argument is a dataset sample
## Third argument is the required size for the output images

# Append the label and image to the output sample
sample_out.labels.append(sample_in.labels.numpy())
sample_out.images.append(np.array(Image.fromarray(sample_in.images.numpy()).resize(new_size)))
sample_out.info.append(sample_in.info.dict())

return sample_out
```
In the above example when new samples are computed we need to make sure all tensors are passed to the sample_out even if it's unmodified. It will be really helpful if we can pipe them directly without explicitly having to get them as numpy or dict.

### Description of the possible solution

``` python
@deeplake.compute
def resize(sample_in, sample_out, new_size):


# Append the label and image to the output sample
sample_out.labels.append(sample_in.labels)
sample_out.images.append(np.array(Image.fromarray(sample_in.images.numpy()).resize(new_size)))
sample_out.info.append(sample_in.info)
return sample_out
```

### An alternative solution to the problem can look like

``` python
@deeplake.compute
def resize(sample_in, sample_out, new_size):


# Append the label and image to the output sample
sample_out.images.append(np.array(Image.fromarray(sample_in.images.numpy()).resize(new_size)))
sample_out.pipe_missing(sample_in)
return sample_out
```
it could also be an additional decorator or an option in the existing decorator.

``` python
@deeplake.compute(pipe_missing=True)
def resize(sample_in, sample_out, new_size):


# Append the label and image to the output sample
sample_out.images.append(np.array(Image.fromarray(sample_in.images.numpy()).resize(new_size)))
return sample_out
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。