Is there any function in pytorch equivalent to preprocess_input
in the below code
from keras.applications.resnet50 import ResNet50, preprocess_input
def people_counter(img_path):
# extract bottleneck features
bottleneck_feature = ResNet50(weights='imagenet', include_top=False).predict(preprocess_input(path_to_tensor(img_path)))
# obtain predicted vector
predicted_vector = model.predict(bottleneck_feature)
# return dog breed that is predicted by the model
return classes[np.argmax(predicted_vector)]