From d21345a3201ec6c9e920a41bfe59cf53e6a0524e Mon Sep 17 00:00:00 2001 From: Han Xiao Date: Tue, 2 Nov 2021 20:06:26 +0100 Subject: [PATCH] docs: update according to new jina api --- README.md | 9 +++++---- docs/get-started/celeba.md | 11 +++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0313fa621..5960e2330 100644 --- a/README.md +++ b/README.md @@ -148,10 +148,11 @@ tuned_model, _ = finetuner.fit( def data_gen(): for d in from_files('./img_align_celeba/*.jpg', size=100, to_dataturi=True): - d.convert_image_uri_to_blob() - d.normalize_image_blob() - d.set_image_blob_channel_axis(-1, 0) #: no need of this line if you are using tf/keras - yield d + yield (d.convert_uri_to_image_blob() + .set_image_blob_normalization() + .set_image_blob_shape(shape=(224, 224)) + .set_image_blob_channel_axis(-1, new_channel_axis=0) #: no need of this line if you are using tf/keras + ) ``` 3. Load pretrained ResNet50 using PyTorch/Keras/Paddle: - PyTorch diff --git a/docs/get-started/celeba.md b/docs/get-started/celeba.md index a5b9cbaa3..ec42a25ee 100644 --- a/docs/get-started/celeba.md +++ b/docs/get-started/celeba.md @@ -26,15 +26,14 @@ Note that Finetuner accepts Jina `DocumentArray`/`DocumentArrayMemmap`, so we fi ```python from jina.types.document.generators import from_files - def data_gen(): # please change the file path to your data path for d in from_files('/Users/jina/Downloads/img_align_celeba/*.jpg', size=100, to_dataturi=True): - d.convert_image_uri_to_blob() - d.normalize_image_blob() - d.resize_image_blob(width=224, height=224) #: no need of this line if you are using pytorch/paddle - d.set_image_blob_channel_axis(-1, 0) #: no need of this line if you are using tf/keras - yield d + yield (d.convert_uri_to_image_blob() + .set_image_blob_normalization() + .set_image_blob_shape(shape=(224, 224)) + .set_image_blob_channel_axis(-1, new_channel_axis=0) + ) ``` ## Load the pretrained model