You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@deeplake.computedefresize(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 samplesample_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())
returnsample_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
@deeplake.computedefresize(sample_in, sample_out, new_size):
# Append the label and image to the output samplesample_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)
returnsample_out
An alternative solution to the problem can look like
@deeplake.computedefresize(sample_in, sample_out, new_size):
# Append the label and image to the output samplesample_out.images.append(np.array(Image.fromarray(sample_in.images.numpy()).resize(new_size)))
sample_out.pipe_missing(sample_in)
returnsample_out
it could also be an additional decorator or an option in the existing decorator.
@deeplake.compute(pipe_missing=True)defresize(sample_in, sample_out, new_size):
# Append the label and image to the output samplesample_out.images.append(np.array(Image.fromarray(sample_in.images.numpy()).resize(new_size)))
returnsample_out
The text was updated successfully, but these errors were encountered:
Hey @neyazbasheer Thank you for raising the issue. Not sure if you noticed the skip_ok flag in .eval(..., skip_ok = True). This should produce the desired behavior. Can you try that out if you have a chance?
🚨🚨 Feature Request
Is your feature request related to a problem?
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
An alternative solution to the problem can look like
it could also be an additional decorator or an option in the existing decorator.
The text was updated successfully, but these errors were encountered: