hey folks, I'm working on a PyTorch use case and f...
# daft-dev
a
hey folks, I'm working on a PyTorch use case and figuring out how to convert the
images
column in my Daft df into proper pytorch tensors was pretty painful. I spent a few hours on this and had to get @jay to help me out in the end. Would be great to have some docs or a friendlier API for this :]
some more painful hoops here to get my tensor col into the right format
I feel like there should be a better way to get
ClassifyImages
to run directly on the
image
column instead of going through 2 steps of preprocessing and storing those in separate df columns I probably won't need later. is there a better way of using expressions here that I'm overlooking?
j
Any suggestions on good APIs here folks? I’m considering… 1. Syntactic sugar on top of pytorch transforms to work directly on our Image column types:
.image.torch_transform(my_transforms)
2. Baking in more of these transforms as Daft expressions:
.image.center_crop().<http://image.to|image.to>_tensor().image.normalize()
3. A
<http://Series.to|Series.to>_torch()
function that returns a correctly batched tensor a. We should probably also figure out our story around
def ___array___
for numpy array conversion?
a
Thanks @jay! I love (1), that's where my mind was going intuitively. It would be great to just run a
udf
directly on the
image
col instead of having to preprocess into separate
tensor
and
pytorch_tensor
cols