Skip to content

Remove Any output from getting started guide #460

Open
@bfirsh

Description

@bfirsh

It'd be nice if we had an example that returned a real output rather than an arbitrary undefined JSON object.

from typing import Any
from cog import BasePredictor, Input, Path
from tensorflow.keras.applications.resnet50 import ResNet50
from tensorflow.keras.preprocessing import image as keras_image
from tensorflow.keras.applications.resnet50 import preprocess_input, decode_predictions
import numpy as np
class ResNetPredictor(BasePredictor):
def setup(self):
"""Load the model into memory to make running multiple predictions efficient"""
self.model = ResNet50(weights='resnet50_weights_tf_dim_ordering_tf_kernels.h5')
# Define the arguments and types the model takes as input
def predict(self, image: Path = Input(description="Image to classify")) -> Any:

See also #273

(edited by @zeke)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions