PIL image _crop to tensor、in tensorflow

リー・ヨンジェ

私はディープラーニングについて勉強している学生です。tensroflowフレームワークを使用してコードを作成しています。だから私は質問があります。Pil.image.cropを使用して切り抜き画像を作成しましたが、トレーニング時にPil.image.cropをテンソルに割り当てることができません。だからどうすればトリミングされた画像をテンソルに割り当てることができますか?Plzは私にアドバイスをくれます。ありがとうございました。これが私のgithubアドレスですhttps://github.com/dldudwo0805/DeepLearningPractice

ヴィジャイm

あなたはでそれを行うことができますtf.image.crop_and_resize次に例を示します。

from scipy.misc import imread
img = imread('flower.jpg') 

# image placeholder
X = tf.placeholder(dtype=tf.uint8, shape=(1, 300,300,3))

# You need to set the area to crop in boxes and resize it to in crop_size
Y = tf.image.crop_and_resize(X,boxes=[[.25,.25,.75,.75]], crop_size=[100, 100], box_ind=[0] )

sess = tf.InteractiveSession()
tf.global_variables_initializer().run()
out = sess.run(Y, {X:np.expand_dims(img,0)})

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

What is the shape of an image tensor in TensorFlow

分類Dev

Crop image in CSS

分類Dev

Tensorflow avoid shape information with crop

分類Dev

Slicing tensor with list - TensorFlow

分類Dev

Drop a dimension of a tensor in Tensorflow

分類Dev

Slice tensor in Keras Tensorflow

分類Dev

Creating tensorflow::Tensor from Eigen::Tensor

分類Dev

opencv: crop image on the GPU side

分類Dev

opencv: crop image on the GPU side

分類Dev

How to scale, rotate and crop an Image

分類Dev

ValueError:tf.image.crop_to_bounding_boxの使用中に、dtypefloat32を持つTensorに対してTensor変換がdtypeint32を要求しました

分類Dev

How to check if a tensor is empty in Tensorflow

分類Dev

Operations on Specific Columns on a Tensor in TensorFlow

分類Dev

Iterate over a tensor dimension in Tensorflow

分類Dev

Flipping tensor and fill with zeros in tensorflow

分類Dev

PILとpygame.image

分類Dev

Tensorflowのtf.image.central_crop()に確率変数を渡すことができません

分類Dev

PIL : PNG image as watermark for a JPG image

分類Dev

image is not uploading after crop using retrofit android

分類Dev

How to "crop" a rectangular image into a square with CSS?

分類Dev

How to crop an image using C#?

分類Dev

how to crop image based on white lines

分類Dev

PHP resize and crop centered-top image

分類Dev

How to crop borders/white spaces from image?

分類Dev

PHP GD resize/crop image before uploading

分類Dev

How to automatically show select for crop on image

分類Dev

Split image tensor into small patches

分類Dev

How to fill a tensor of values based on tensor of indices in tensorflow?

分類Dev

In Tensorflow How can I add a Tensor to another Tensor with different shape?

Related 関連記事

  1. 1

    What is the shape of an image tensor in TensorFlow

  2. 2

    Crop image in CSS

  3. 3

    Tensorflow avoid shape information with crop

  4. 4

    Slicing tensor with list - TensorFlow

  5. 5

    Drop a dimension of a tensor in Tensorflow

  6. 6

    Slice tensor in Keras Tensorflow

  7. 7

    Creating tensorflow::Tensor from Eigen::Tensor

  8. 8

    opencv: crop image on the GPU side

  9. 9

    opencv: crop image on the GPU side

  10. 10

    How to scale, rotate and crop an Image

  11. 11

    ValueError:tf.image.crop_to_bounding_boxの使用中に、dtypefloat32を持つTensorに対してTensor変換がdtypeint32を要求しました

  12. 12

    How to check if a tensor is empty in Tensorflow

  13. 13

    Operations on Specific Columns on a Tensor in TensorFlow

  14. 14

    Iterate over a tensor dimension in Tensorflow

  15. 15

    Flipping tensor and fill with zeros in tensorflow

  16. 16

    PILとpygame.image

  17. 17

    Tensorflowのtf.image.central_crop()に確率変数を渡すことができません

  18. 18

    PIL : PNG image as watermark for a JPG image

  19. 19

    image is not uploading after crop using retrofit android

  20. 20

    How to "crop" a rectangular image into a square with CSS?

  21. 21

    How to crop an image using C#?

  22. 22

    how to crop image based on white lines

  23. 23

    PHP resize and crop centered-top image

  24. 24

    How to crop borders/white spaces from image?

  25. 25

    PHP GD resize/crop image before uploading

  26. 26

    How to automatically show select for crop on image

  27. 27

    Split image tensor into small patches

  28. 28

    How to fill a tensor of values based on tensor of indices in tensorflow?

  29. 29

    In Tensorflow How can I add a Tensor to another Tensor with different shape?

ホットタグ

アーカイブ