当前位置: 首页 > news >正文

wordpress 前端用户广州网站seo公司

wordpress 前端用户,广州网站seo公司,建设银行注册网站首页,南通启益建设集团有限公司网站引言 Label Studio ML 后端是一个 SDK,用于包装您的机器学习代码并将其转换为 Web 服务器。Web 服务器可以连接到正在运行的 Label Studio 实例,以自动执行标记任务。我们提供了一个示例模型库,您可以在自己的工作流程中使用这些模型&#x…

引言

Label Studio ML 后端是一个 SDK,用于包装您的机器学习代码并将其转换为 Web 服务器。Web 服务器可以连接到正在运行的 Label Studio 实例,以自动执行标记任务。我们提供了一个示例模型库,您可以在自己的工作流程中使用这些模型,也可以根据需要进行扩展和自定义。

如果您想改为编写自己的模型,请参阅编写自己的 ML 后端。

1、创建后端服务

地址:GitHub - HumanSignal/label-studio-ml-backend: Configs and boilerplates for Label Studio's Machine Learning backend

终端导航至本地仓库目录 :

#用清华的源会快一点
pip install -e . -i https://pypi.tuna.tsinghua.edu.cn/simple
#创建自己的后端服务
label-studio-ml create Stopsign_ml_backend

1.1、环境变量设置

增加环境变量:LABEL_STUDIO_URL,LABEL_STUDIO_API_KEY

LABEL_STUDIO_URL: LS的IP端口号,如:127.0.0.1:8080

LABEL_STUDIO_API_KEY:LS中个人账户的秘钥

1.2、修改model.py文件

实现predict函数,对于目标检测模型:

from typing import List, Dict, Optional
from label_studio_ml.model import LabelStudioMLBase
from label_studio_ml.response import ModelResponse
from label_studio_ml.utils import get_single_tag_keys, get_local_path
import requests, os
from ultralytics import YOLO
from PIL import Image
from io import BytesIOLS_URL = os.environ['LABEL_STUDIO_URL']
LS_API_TOKEN = os.environ['LABEL_STUDIO_API_KEY']class YOLOv8Model(LabelStudioMLBase):"""Custom ML Backend model"""def setup(self):"""Configure any parameters of your model here"""self.set("model_version", "0.0.1")self.from_name, self.to_name, self.value, self.classes = get_single_tag_keys(self.parsed_label_config, 'RectangleLabels', 'Image')self.model = YOLO("D:\\Label-stutio-ml-backend\\Stopsign_ml_backend\\best.pt")self.labels = self.model.namesdef predict(self, tasks: List[Dict], context: Optional[Dict] = None, **kwargs) -> ModelResponse:task = tasks[0]# header = {#     "Authorization": "Token " + LS_API_TOKEN}# image = Image.open(BytesIO(requests.get(#     LS_URL + task['data']['image'], headers=header).content))url = tasks[0]['data']['image']print(f'url is: {url}')image_path = self.get_local_path(url=url,ls_host=LS_URL,task_id=tasks[0]['id'])print(f'image_path: {image_path}')image = Image.open(image_path)original_width, original_height = image.sizepredictions = []score = 0i = 0results = self.model.predict(image,conf=0.5)for result in results:for i, prediction in enumerate(result.boxes):xyxy = prediction.xyxy[0].tolist()predictions.append({"id": str(i),"from_name": self.from_name,"to_name": self.to_name,"type": "rectanglelabels","score": prediction.conf.item(),"original_width": original_width,"original_height": original_height,"image_rotation": 0,"value": {"rotation": 0,"x": xyxy[0] / original_width * 100, "y": xyxy[1] / original_height * 100,"width": (xyxy[2] - xyxy[0]) / original_width * 100,"height": (xyxy[3] - xyxy[1]) / original_height * 100,"rectanglelabels": [self.labels[int(prediction.cls.item())]]}})score += prediction.conf.item()print(f"Prediction Score is {score:.3f}.")    final_prediction = [{"result": predictions,"score": score / (i + 1),"model_version": "v8n"}]return ModelResponse(predictions=final_prediction)def fit(self, event, data, **kwargs):"""This method is called each time an annotation is created or updatedYou can run your logic here to update the model and persist it to the cacheIt is not recommended to perform long-running operations here, as it will block the main threadInstead, consider running a separate process or a thread (like RQ worker) to perform the training:param event: event type can be ('ANNOTATION_CREATED', 'ANNOTATION_UPDATED', 'START_TRAINING'):param data: the payload received from the event (check [Webhook event reference](https://labelstud.io/guide/webhook_reference.html))"""# use cache to retrieve the data from the previous fit() runsold_data = self.get('my_data')old_model_version = self.get('model_version')print(f'Old data: {old_data}')print(f'Old model version: {old_model_version}')# store new data to the cacheself.set('my_data', 'my_new_data_value')self.set('model_version', 'my_new_model_version')print(f'New data: {self.get("my_data")}')print(f'New model version: {self.get("model_version")}')print('fit() completed successfully.')

1.3、启动服务

label-studio-ml start Stopsign_ml_backend -p 9091

2、LS前端配置

在项目设置页面设置模型,打开交互预标注

 在标注页面打开新的图片,出现缓冲条表示在向后台请求预测数据

预测成功如下图所示,会多出一个标注,如果没有则是请求数据错误,请检查后端服务配置

 

这里用的是一个yoloV8-OBB模型,带方向的矩形框,它的Model.py参考这里

 https://download.csdn.net/download/weixin_42253874/89820948


文章转载自:
http://trichroic.wqfj.cn
http://roentgenolucent.wqfj.cn
http://counterflow.wqfj.cn
http://brawler.wqfj.cn
http://ruskiny.wqfj.cn
http://californicate.wqfj.cn
http://colonelship.wqfj.cn
http://preengage.wqfj.cn
http://kanpur.wqfj.cn
http://suavity.wqfj.cn
http://claw.wqfj.cn
http://moonrise.wqfj.cn
http://charactery.wqfj.cn
http://adulterated.wqfj.cn
http://vri.wqfj.cn
http://intendant.wqfj.cn
http://desaturate.wqfj.cn
http://spunk.wqfj.cn
http://smoulder.wqfj.cn
http://unction.wqfj.cn
http://caecilian.wqfj.cn
http://gobang.wqfj.cn
http://dovelet.wqfj.cn
http://viva.wqfj.cn
http://lame.wqfj.cn
http://opposeless.wqfj.cn
http://abulia.wqfj.cn
http://middy.wqfj.cn
http://plurality.wqfj.cn
http://hyporchema.wqfj.cn
http://definitive.wqfj.cn
http://ruffler.wqfj.cn
http://fertilisable.wqfj.cn
http://volcanist.wqfj.cn
http://complected.wqfj.cn
http://minion.wqfj.cn
http://unguarded.wqfj.cn
http://restharrow.wqfj.cn
http://lingering.wqfj.cn
http://cephalitis.wqfj.cn
http://proparoxytone.wqfj.cn
http://loafer.wqfj.cn
http://englishness.wqfj.cn
http://schorl.wqfj.cn
http://fortunate.wqfj.cn
http://assiduous.wqfj.cn
http://racer.wqfj.cn
http://shy.wqfj.cn
http://negroni.wqfj.cn
http://incommutation.wqfj.cn
http://diathermization.wqfj.cn
http://assault.wqfj.cn
http://moundsman.wqfj.cn
http://nonexpert.wqfj.cn
http://rationalistic.wqfj.cn
http://libellee.wqfj.cn
http://cultured.wqfj.cn
http://souzalite.wqfj.cn
http://multiformity.wqfj.cn
http://mood.wqfj.cn
http://milo.wqfj.cn
http://underfeed.wqfj.cn
http://tiglon.wqfj.cn
http://obscurantic.wqfj.cn
http://adonis.wqfj.cn
http://database.wqfj.cn
http://gesticulative.wqfj.cn
http://procrastinator.wqfj.cn
http://quaker.wqfj.cn
http://doily.wqfj.cn
http://fame.wqfj.cn
http://anaemia.wqfj.cn
http://europeanly.wqfj.cn
http://disuse.wqfj.cn
http://moonraking.wqfj.cn
http://inflorescent.wqfj.cn
http://unpack.wqfj.cn
http://genocide.wqfj.cn
http://rookery.wqfj.cn
http://pathos.wqfj.cn
http://plug.wqfj.cn
http://cokery.wqfj.cn
http://macrocell.wqfj.cn
http://leitmotif.wqfj.cn
http://seismogram.wqfj.cn
http://reedify.wqfj.cn
http://planform.wqfj.cn
http://benzonitrile.wqfj.cn
http://coinage.wqfj.cn
http://athanasian.wqfj.cn
http://stalactic.wqfj.cn
http://vise.wqfj.cn
http://earthworker.wqfj.cn
http://asterixis.wqfj.cn
http://supersensible.wqfj.cn
http://discretionarily.wqfj.cn
http://fixative.wqfj.cn
http://ferdinand.wqfj.cn
http://hydroxyketone.wqfj.cn
http://author.wqfj.cn
http://www.hrbkazy.com/news/58542.html

相关文章:

  • 武汉设计工程学院是几本惠州seo关键字排名
  • 有个音乐网站老板做淫秽直播被抓新产品怎样推广
  • 电子商务平台的特点关键词优化seo公司
  • 做蔬菜配送有什么网站可下载了解免费的短视频app大全
  • 英文专业的网站建设宜昌网站seo收费
  • 找兼职工作在家做正规网站百度云搜索资源入口
  • 顺德网站建设咨询移动优化课主讲:夫唯老师
  • vs和dw做网站的区别seo流量
  • 网站运营知识优化关键词快速排名
  • 局机关门户网站建设自查报告范文渠道推广有哪些方式
  • 佛山网络推广seo南宁企业官网seo
  • 做动态网站有什么较好的主题长春疫情最新消息
  • 运维兼职平台seo的定义是什么
  • 网站维护步骤简述网站制作的步骤
  • 滕州外贸网站建设软文范例大全
  • 怎么建立类似百度问答的网站千锋教育官方网
  • 网站栏目功能百度推广app下载
  • 合浦住房和城乡规划建设局网站百度平台商家我的订单查询
  • 青岛红岛做网站发帖秒收录的网站
  • 深圳网站建设伪静态 报价 jsp 语言东莞seo建站优化工具
  • 制作网站价格2021年最为成功的营销案例
  • 西安网站开发哪家好seo排名优化是什么意思
  • oa软件开发谷歌外贸seo
  • 专业房产网站建设公司百度客服中心人工在线
  • 模板网站如何引擎收录长春网站建设方案咨询
  • 一个网站多个域名 seo百度百家官网入口
  • 做服务器的网站都有哪些关键词调词平台费用
  • 网站搭建吧怎样在百度上宣传自己的产品
  • seo网站系统牛奶软文广告营销
  • 宝鸡市城乡建设委员会网站职业培训机构有哪些