Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

349
Vistas
How to preprocess input image in JavaScript for keras resnet152v2?

I'm trying to run ResNet152V2 in TensorFlowJS in Browser, but I've got problem with input processing. In Tensorflow (python), to get correct predictions, all I need to do is call tf.keras.applications.resnet_v2.preprocess_input on inputs before passing them to the model. It scales input pixels between -1 and 1 (according to https://keras.io/api/applications/resnet/).

url = 'my_image.png'

img = image.load_img(url, target_size=(224, 224))

img_array = image.img_to_array(img) 
img_batch = np.expand_dims(img_array, axis=0)
img_preprocessed = tf.keras.applications.resnet_v2.preprocess_input(img_batch)

prediction = model.predict(img_preprocessed)
print(prediction.argmax(axis=-1))

Im trying to find out, how to do it in browser in JavaScript.

Thanks for help

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda