computer visionでAPIを用いてpythonによる画像検出WEBアプリを作成しています。
画像アップロードまで作成しましたが、実際に画像をアップロードする際に、
ComputerVisionErrorResponseException: (401) The Detect Objects Operation under Computer Vision API (v3.2) is not supported with the current subscription key and pricing tier Custom_Vision.Training.F0.
というエラーが出てしまいます。
現在のバージョンではdetect objects operationがサポートされていないということだと思うので、computervisionを見ているのですが、なかなか良い解決策が見つかりません。
どなたか教えていただければ幸いです。
コードは以下のようになっています。
python
computervision_client = ComputerVisionClient(ENDPOINT, CognitiveServicesCredentials(KEY)) def get_tags(filepath): local_image=open(filepath,'rb') tags_result = computervision_client.tag_image_in_stream(local_image ) tags=tags_result.tags tags_name=[] for tag in tags: tags_name.append(tag.name) return tags_name def detect_objects(filepath): local_image=open(filepath,'rb') detect_objects_results = computervision_client.detect_objects_in_stream(local_image ) objects=detect_objects_results.objects return objects uploaded_file=st.file_uploader('choose an image...',type=['jpg','png']) if uploaded_file is not None: img=Image.open(uploaded_file) img_path=f'img/{uploaded_file.name}' img.save(img_path) objects=detect_objects(img_path)
まだ回答がついていません
会員登録して回答してみよう