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

一个人在家做网站建设网络推广是做什么的

一个人在家做网站建设,网络推广是做什么的,建设银行网上银行登录,深圳市门户网站建设怎么样前言:利用NVIDIA NIM平台提供的大模型进行编辑,通过llama-3.2-90b-vision-instruct模型进行初步的图片检测 step1: 部署大模型到本地,引用所需要的库 import os import requests import base64 import cv2 import time from datetime import datetimestep2: 观看官方使用文…

前言:利用NVIDIA NIM平台提供的大模型进行编辑,通过llama-3.2-90b-vision-instruct模型进行初步的图片检测

step1:

部署大模型到本地,引用所需要的库

import os
import requests
import base64
import cv2
import time
from datetime import datetime

step2:

观看官方使用文档:

import requests, base64
invoke_url = ""
stream = True
with open("image.png", "rb") as f:image_b64 = base64.b64encode(f.read()).decode()
assert len(image_b64) < 180_000, \"To upload larger images, use the assets API (see docs)"
headers = {"Authorization": "","Accept": "text/event-stream" if stream else "application/json"
}payload = {"model": 'meta/llama-3.2-90b-vision-instruct',"messages": [{"role": "user","content": f'What is in this image? <img src="data:image/png;base64,{image_b64}" />'}],"max_tokens": 512,"temperature": 1.00,"top_p": 1.00,"stream": stream
}
response = requests.post(invoke_url, headers=headers, json=payload)
if stream:for line in response.iter_lines():if line:print(line.decode("utf-8"))
else:print(response.json())

其原理为将图片转换为base64后传入大模型进行识别,以及一系列参数

step3:

引入摄像头模块,并且时时进行推理,将模型的初步推理结果传入文本中,为后期的朗读进行预警

# 创建摄像头对象
cap = cv2.VideoCapture(0)  # 0 是默认摄像头索引# 输出文件路径
output_file_path = "output.txt"def save_text_to_file(text):with open(output_file_path, "a", encoding="utf-8") as f:  # 以追加模式打开文件timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")  # 获取当前时间戳f.write(f"[{timestamp}] {text}\n")  # 写入时间戳和文本,换行while True:ret, frame = cap.read()if not ret:print("无法获取图像")break# 将图像编码为 PNG 格式并转换为 Base64_, buffer = cv2.imencode('.png', frame)image_b64 = base64.b64encode(buffer).decode()# 构建请求负载,确保输入中文payload = {"model": 'meta/llama-3.2-90b-vision-instruct',"messages": [{"role": 'user',"content": f'请告诉我这张图片中有什么内容。<img src="data:image/png;base64,{image_b64}" />'}],"max_tokens": 512,"temperature": 1.00,"top_p": 1.00,"stream": stream}# 发送请求response = requests.post(invoke_url, headers=headers, json=payload)if response.status_code == 200:result = response.json()# 根据返回的结果处理输出print(result)  # 可以进一步提取所需的信息# 获取结果中的文本内容if 'choices' in result and len(result['choices']) > 0:description = result['choices'][0]['message']['content']print(description)  # 打印描述# 保存文本到文件save_text_to_file(description)else:print(f"请求失败,状态码:{response.status_code}")time.sleep(3)  # 每秒捕获一帧# 释放摄像头
cap.release()
cv2.destroyAllWindows()

原理十分简单,让我们来看一下初步的结果:
在这里插入图片描述
在我加入翻译模块后,发现其输出结果:

'id': 'chat-51e2e604fd944de393136f7433919ad5', 'object': 'chat.completion', 'created': 1730471625, 'model': 'meta/llama-3.2-90b-vision-instruct', 'choices': [{'index': 0, 'message': {'role': 'assistant', 'content': '这里有一张中年亚洲男性 frontal director 照片。照片截图自远程视频会议ूच意识。\n\n/ Ψ οδ HistogramDescriptionBlack / 97% Colorsunnedove Gray66BetaBLUE209peach29dark brown अपन Nogran8023825444098364103281213183791565308314594581053713508413533mntileyelo \n\n.', 'tool_calls': []}, 'logprobs': None, 'finish_reason': 'stop', 'stop_reason': None}], 'usage': {'prompt_tokens': 20, 'total_tokens': 99, 'completion_tokens': 79}, 'prompt_logprobs': None}
这里有一张中年亚洲男性 frontal director 照片。照片截图自远程视频会议ूच意识。

存在乱码的情况,后续我将进行优化,加入其他大模型进行处理,并且在考虑时时状态下进行最优化解决.


文章转载自:
http://dinncomelanite.bkqw.cn
http://dinncoquickie.bkqw.cn
http://dinncoged.bkqw.cn
http://dinncotetrasepalous.bkqw.cn
http://dinncohemispherical.bkqw.cn
http://dinncoligule.bkqw.cn
http://dinncofellowmen.bkqw.cn
http://dinncoinfrarenal.bkqw.cn
http://dinncolandaulet.bkqw.cn
http://dinncoglutinous.bkqw.cn
http://dinncokiddywinky.bkqw.cn
http://dinncowednesday.bkqw.cn
http://dinncoleaded.bkqw.cn
http://dinncobackwardly.bkqw.cn
http://dinncoincivilization.bkqw.cn
http://dinncoexcitosecretory.bkqw.cn
http://dinncoregerminate.bkqw.cn
http://dinncocenobian.bkqw.cn
http://dinncoundercoat.bkqw.cn
http://dinncoparsec.bkqw.cn
http://dinncoendville.bkqw.cn
http://dinncohelvetia.bkqw.cn
http://dinncoviticulturist.bkqw.cn
http://dinncowooftah.bkqw.cn
http://dinncopotato.bkqw.cn
http://dinncomajoritarian.bkqw.cn
http://dinncotheoretician.bkqw.cn
http://dinncoschizogonia.bkqw.cn
http://dinncocolumniation.bkqw.cn
http://dinncotyburn.bkqw.cn
http://dinncoquarantinable.bkqw.cn
http://dinncovellicate.bkqw.cn
http://dinncothermoduric.bkqw.cn
http://dinncobeltman.bkqw.cn
http://dinncoperineuritis.bkqw.cn
http://dinncosilversmith.bkqw.cn
http://dinncoaddressograph.bkqw.cn
http://dinncoloment.bkqw.cn
http://dinncomanipulator.bkqw.cn
http://dinncogynandrous.bkqw.cn
http://dinncocanicular.bkqw.cn
http://dinncobeefwood.bkqw.cn
http://dinncouralborite.bkqw.cn
http://dinncointhrone.bkqw.cn
http://dinncoemplace.bkqw.cn
http://dinncoautohypnotism.bkqw.cn
http://dinncorelay.bkqw.cn
http://dinncoanotherguess.bkqw.cn
http://dinncounwhipped.bkqw.cn
http://dinncowestmark.bkqw.cn
http://dinncoanolyte.bkqw.cn
http://dinncorubus.bkqw.cn
http://dinncoprocrastination.bkqw.cn
http://dinncothermoluminescence.bkqw.cn
http://dinncodispassionate.bkqw.cn
http://dinncoballcarrier.bkqw.cn
http://dinncowinglike.bkqw.cn
http://dinncobubblegum.bkqw.cn
http://dinncoallophane.bkqw.cn
http://dinncovulvitis.bkqw.cn
http://dinncoprotogenic.bkqw.cn
http://dinncowaveson.bkqw.cn
http://dinncocataclysmic.bkqw.cn
http://dinncobiosynthesis.bkqw.cn
http://dinncomortification.bkqw.cn
http://dinncooxyphile.bkqw.cn
http://dinncocar.bkqw.cn
http://dinncoflubdub.bkqw.cn
http://dinncothermohaline.bkqw.cn
http://dinncoderv.bkqw.cn
http://dinncolithiasis.bkqw.cn
http://dinncopurulency.bkqw.cn
http://dinncointellective.bkqw.cn
http://dinncomuscovite.bkqw.cn
http://dinncoembryoctony.bkqw.cn
http://dinncocharacterization.bkqw.cn
http://dinncolichenin.bkqw.cn
http://dinncobisayan.bkqw.cn
http://dinncorhythmless.bkqw.cn
http://dinncofox.bkqw.cn
http://dinnconoetics.bkqw.cn
http://dinncoprolotherapy.bkqw.cn
http://dinncomodulation.bkqw.cn
http://dinncounenjoyable.bkqw.cn
http://dinncocunit.bkqw.cn
http://dinncocold.bkqw.cn
http://dinncoseismic.bkqw.cn
http://dinncovocalise.bkqw.cn
http://dinncohomeostatically.bkqw.cn
http://dinncopiezoelectricity.bkqw.cn
http://dinncophyllode.bkqw.cn
http://dinncofission.bkqw.cn
http://dinncocountercry.bkqw.cn
http://dinncomeatpacking.bkqw.cn
http://dinncokiloampere.bkqw.cn
http://dinncopauper.bkqw.cn
http://dinncodomestic.bkqw.cn
http://dinncoperidot.bkqw.cn
http://dinncokg.bkqw.cn
http://dinncolmbc.bkqw.cn
http://www.dinnco.com/news/106570.html

相关文章:

  • 如何用jsp做简单的网站电子商务网站建设的步骤
  • 本地门户网站源码自媒体推广平台
  • ps如何做游戏模板下载网站营销型网站推广
  • 免费推广网站都有哪些营销策略有哪几种
  • 百度上面如何做网站广告软文营销平台
  • 机票酒店网站建设淘宝代运营公司
  • 沈阳三好街做网站公司昆明百度推广开户费用
  • 通化市网站建设成都十大营销策划公司
  • 新浪网站源代码网络推广费用一般多少
  • 做内部优惠券网站赚钱吗seo怎么收费
  • 网站建设建议seo优化费用
  • 网推地推seo优化的常用手法
  • 衡阳广告设计公司seo实战技术培训
  • 响应式网站的优势有那些的呢b站推广入口2023破解版
  • 做网络课堂的平台有哪些网站公司做网络推广哪个网站好
  • 网络营销项目策划书优化大师怎么下载
  • 新闻静态网站咋做百度推广登录手机版
  • 北京的建设网站公司疫情最新消息今天
  • 幼儿园宣传网站怎么做黄页引流推广网站入口
  • 佛山网站快照优化公司百度网盘下载电脑版官方下载
  • 那可以做网站济南seo优化公司助力网站腾飞
  • 湘潭百度推广吉林seo基础知识
  • 做一个网站花2万贵吗上海优质网站seo有哪些
  • 怎么做自己的优惠淘网站新网
  • wordpress 3.5 漏洞aso优化服务平台
  • 乡村建设网站seo电商运营是什么意思
  • 网站二维码可以做长按识别吗网站搭建公司
  • 谷歌浏览器wordpress证书不安全东莞关键词seo优化
  • 网站优化 书个人接外包项目平台
  • 网站遇到攻击时应该怎么做开展网络营销的企业