You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear Bumble tech,
I've been attempting to convert the private-detector's saved_model into a CoreML model. However, after the conversion, it seems unable to successfully identify NSFW images. I suspect there might be an issue during the conversion process. Could you guide me on how to correctly convert a saved_model.pb into a CoreML .mlPackage? Thanks a lot!
Here's my code:
fromPILimportImageimg=Image.open('/Path/To/Desktop/dick3.png')
img=img.resize((480,480))
ifimg.mode!='RGB':
img=img.convert('RGB')
out_dict=mlmodel_from_tf.predict({"model_input_images": img})
print(out_dict)
# {'Identity': array([[0.00386974, 0.9961302 ]], dtype=float32)}# I believe the first element of the array represents the "confidence level that the content is NSFW." or I'm misunderstanding something?
The text was updated successfully, but these errors were encountered:
Hey! - Sorry about the delay in getting round to this
Hmm tbh I've no experience in using CoreML models, so I'm quite limited in what I can do to help 😢
What results are you getting for that image with the normal SavedModel inference? It doesn't seem like you're recreating the preprocessing functions for images with that setup so I'm thinking that may be causing the issue
Hi @Steeeephen ,
The problem was indeed that I hadn't implemented the preprocess function.
After implementing the preprocess function in Swift, I was able to get the correct results.
Thank you very much for your guidance : )
Dear Bumble tech,
I've been attempting to convert the private-detector's saved_model into a CoreML model. However, after the conversion, it seems unable to successfully identify NSFW images. I suspect there might be an issue during the conversion process. Could you guide me on how to correctly convert a saved_model.pb into a CoreML .mlPackage? Thanks a lot!
Here's my code:
Results of testing the CoreML model:
The text was updated successfully, but these errors were encountered: