Skip to content

Commit

Permalink
docs: update according to new jina api
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxiao committed Nov 2, 2021
1 parent 1e4a1ae commit d21345a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions docs/get-started/celeba.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d21345a

Please sign in to comment.