Sobes.tech
Junior — Middle

Have you had experience working with computer vision models?

sobes.tech AI

Answer from AI

Yes, I have worked with computer vision models, including image classification, object detection, and segmentation tasks. For example, I used libraries like OpenCV and TensorFlow for image processing and neural network training.

Here's an example of a simple image classification model using TensorFlow and Keras:

from tensorflow.keras.applications import MobileNetV2
from tensorflow.keras.preprocessing import image
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input, decode_predictions
import numpy as np

model = MobileNetV2(weights='imagenet')

img_path = 'elephant.jpg'
img = image.load_img(img_path, target_size=(224, 224))
x = image.img_to_array(img)
x = np.expand_dims(x, axis=0)
x = preprocess_input(x)

preds = model.predict(x)
print('Predicted:', decode_predictions(preds, top=3)[0])

This example shows how to load a pre-trained model and make a prediction on an image.