2

I want to use the visual Recognition from IBM (Classify an image) by using python 3.7 but it gives this error :

main:3: DeprecationWarning: VisualRecognitionV3 is a deprecated function. watson-developer-cloud moved to ibm-watson

Whatever I try to do it gives the same error :

import json
from watson_developer_cloud import VisualRecognitionV3
visual_recognition = VisualRecognitionV3(
     '2018-03-19',
     iam_apikey='API_KEY')
hndr
  • 757
  • 13
  • 29
  • 1
    @skagreen123, I added the deprecation as just as a warning. You should be able to invoke the method without any error. – Erika Dsouza Apr 03 '19 at 19:35

2 Answers2

2

Check the installation guide at for the project. The package has moved to ibm-watson, so you should install that package and import from it

hndr
  • 757
  • 13
  • 29
0
from ibm_watson import VisualRecognitionV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator

authenticator = IAMAuthenticator(api_key)
visual_rec = VisualRecognitionV3('2020-07-14',authenticator = authenticator)

import json
class_ = visual_rec.classify(url=image_url , threshold=0.5 , classifier_ids=None).get_result()
print(json.dumps(class_ , indent=2))
Sumit
  • 11
  • 2