Hi Thomas,
Can you tell me how do I put custom codes in visualsearch.py
Let's say that I want to do some Object Detection using some other framework (Keras-retinanet) and then I want to find feature vector for every object detected in the image.
I was thinking to add these steps inside the _preprocess function of visualsearch.py
VisualSearch.py would look like -
Importing additional keras_retinanet libraries
import keras
import tensorflow as tf
from keras_retinanet.models import load_model # Helps in loading object detection model
from keras_retinanet.utils.image import read_image_bgr, preprocess_image, resize_image
A url of s3 where the .h5 is located -
MODEL_URL = '........amazonaws.com/mod_objdet.h5'
class VisualSearchService(MXNetBaseService) will have codes to download the model and load the model
_preprocess function should have the codes that will generate bounding boxes, cropping the image and then finding the feature vector for each cropped item.
I tried it locally by running the mxnet-model-server after archiving all the files but it doesnt seem to work.
Gives me the following error -
' ModuleNotFoundError: No module named 'keras_retinanet'
I m running this inside an env which has Keras-retinanet and mxnet and their dependencies.
Is this approach appropriate?
Can you suggest me something else which is better than this approach?
Hi Thomas, Can you tell me how do I put custom codes in visualsearch.py
Let's say that I want to do some Object Detection using some other framework (Keras-retinanet) and then I want to find feature vector for every object detected in the image. I was thinking to add these steps inside the _preprocess function of visualsearch.py
VisualSearch.py would look like -
Importing additional keras_retinanet libraries
A url of s3 where the .h5 is located -
MODEL_URL = '........amazonaws.com/mod_objdet.h5'
class VisualSearchService(MXNetBaseService) will have codes to download the model and load the model
_preprocess function should have the codes that will generate bounding boxes, cropping the image and then finding the feature vector for each cropped item.
I tried it locally by running the mxnet-model-server after archiving all the files but it doesnt seem to work.
Gives me the following error -
' ModuleNotFoundError: No module named 'keras_retinanet'
I m running this inside an env which has Keras-retinanet and mxnet and their dependencies.