Skip to content

Commit 578b7f0

Browse files
lu-wang-dlsueann
authored andcommitted
Correct the images reader call in README (#127)
README to use Spark's version of readImages not sparkdl's own.
1 parent a928839 commit 578b7f0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,10 @@ There are many well-known deep learning models for images. If the task at hand i
226226

227227

228228
```python
229-
from sparkdl import readImages, DeepImagePredictor
229+
from pyspark.ml.image import ImageSchema
230+
from sparkdl import DeepImagePredictor
230231

231-
image_df = readImages(sample_img_dir)
232+
image_df = ImageSchema.readImages(sample_img_dir)
232233

233234
predictor = DeepImagePredictor(inputCol="image", outputCol="predicted_labels", modelName="InceptionV3", decodePredictions=True, topK=10)
234235
predictions_df = predictor.transform(image_df)
@@ -239,7 +240,8 @@ Deep Learning Pipelines provides an MLlib Transformer that will apply the given
239240

240241

241242
```python
242-
from sparkdl import readImages, TFImageTransformer
243+
from pyspark.ml.image import ImageSchema
244+
from sparkdl import TFImageTransformer
243245
import sparkdl.graph.utils as tfx # strip_and_freeze_until was moved from sparkdl.transformers to sparkdl.graph.utils in 0.2.0
244246
from sparkdl.transformers import utils
245247
import tensorflow as tf
@@ -255,7 +257,7 @@ transformer = TFImageTransformer(inputCol="image", outputCol="predictions", grap
255257
inputTensor=image_arr, outputTensor=resized_images,
256258
outputMode="image")
257259

258-
image_df = readImages(sample_img_dir)
260+
image_df = ImageSchema.readImages(sample_img_dir)
259261
processed_image_df = transformer.transform(image_df)
260262
```
261263

@@ -456,9 +458,9 @@ registerKerasImageUDF("inceptionV3_udf_with_preprocessing", InceptionV3(weights=
456458
Once a UDF has been registered, it can be used in a SQL query, e.g.
457459

458460
```python
459-
from sparkdl import readImages
461+
from pyspark.ml.image import ImageSchema
460462

461-
image_df = readImages(sample_img_dir)
463+
image_df = ImageSchema.readImages(sample_img_dir)
462464
image_df.registerTempTable("sample_images")
463465
```
464466

0 commit comments

Comments
 (0)