问题:使用自定义视觉模型下载 & python API
Question: Model dowloading with custom vision & python API
我是 Microsoft Custom Vision 的新手,我正在使用 jupyter notebooks/python 集成 Microsoft Azure Custom Vision API。我能够上传图像,自动标记它们并训练第一次迭代。但是,当我尝试下载火车 iteration/model 的 Docker 文件时,我在尝试导出模型时遇到了困难。使用函数 export_iteration 我最终得到了一个 mst.rest.pipeline.clientrawresponse 对象 。我认为目前它只存储在导出队列中。如何访问此队列元素以将其下载到我的本地系统?
PS:我正在使用通用(紧凑)模型格式,因此它应该可以导出。
示例代码:
# Initalize the Training Client
training_key = "your-training-key"
ENDPOINT = "your-endpoint"
c_plat = CustomVisionTrainingClient(training_key,ENDPOINT)
# List all projects you have
projects = c_plat.get_projects()
#Always take the newest project and its newest iteration and export it
iterations = c_plat.get_iterations(projects[0].id)
c_plat.export_iteration(project_id=projects[0].id, iteration_id=iterations[0].id, platform = "DockerFile", raw=True, flavor = "ARM")
经过反复试验,我找到了解决方案:
#Always takes the newest project and its newest iteration
iterations = c_plat.get_iterations(projects[0].id)
response = c_plat.export_iteration(project_id=projects[0].id, iteration_id=iterations[0].id, platform = "DockerFile", raw=False, flavor="ARM")
# Opnening the uri
import webbrowser
webbrowser.open(c_plat.get_exports(project_id=projects[0].id, iteration_id=iterations[0].id)[0].download_uri)
这会在新选项卡中打开 uri 并开始自动下载。希望这可以帮助别人。
干杯!
我是 Microsoft Custom Vision 的新手,我正在使用 jupyter notebooks/python 集成 Microsoft Azure Custom Vision API。我能够上传图像,自动标记它们并训练第一次迭代。但是,当我尝试下载火车 iteration/model 的 Docker 文件时,我在尝试导出模型时遇到了困难。使用函数 export_iteration 我最终得到了一个 mst.rest.pipeline.clientrawresponse 对象 。我认为目前它只存储在导出队列中。如何访问此队列元素以将其下载到我的本地系统?
PS:我正在使用通用(紧凑)模型格式,因此它应该可以导出。
示例代码:
# Initalize the Training Client
training_key = "your-training-key"
ENDPOINT = "your-endpoint"
c_plat = CustomVisionTrainingClient(training_key,ENDPOINT)
# List all projects you have
projects = c_plat.get_projects()
#Always take the newest project and its newest iteration and export it
iterations = c_plat.get_iterations(projects[0].id)
c_plat.export_iteration(project_id=projects[0].id, iteration_id=iterations[0].id, platform = "DockerFile", raw=True, flavor = "ARM")
经过反复试验,我找到了解决方案:
#Always takes the newest project and its newest iteration
iterations = c_plat.get_iterations(projects[0].id)
response = c_plat.export_iteration(project_id=projects[0].id, iteration_id=iterations[0].id, platform = "DockerFile", raw=False, flavor="ARM")
# Opnening the uri
import webbrowser
webbrowser.open(c_plat.get_exports(project_id=projects[0].id, iteration_id=iterations[0].id)[0].download_uri)
这会在新选项卡中打开 uri 并开始自动下载。希望这可以帮助别人。
干杯!