pip install modelscope
pip install "modelscope(multi-modal)"
from modelscope.pipelines import pipeline
classifier = pipeline('text-classification', model='damo/nlp_structbert_text-classification_chinese-base')
result = classifier('我喜欢吃苹果')
print(result)
from modelscope.pipelines import pipeline
recognizer = pipeline('image-classification', model='damo/cv_resnet50_image-classification_chinese-base')
result = recognizer('image.jpg')
print(result)
from modelscope.pipelines import pipeline
generator = pipeline('text-to-image', model='damo/multi-modal_diffusion_text-to-image_chinese-base')
result = generator('一只可爱的小猫')
print(result)
from modelscope.pipelines import pipeline
# 情感分析
sentiment_analyzer = pipeline('sentiment-analysis', model='damo/nlp_structbert_sentiment-analysis_chinese-base')
sentiment_result = sentiment_analyzer('这部电影非常好看')
# 根据情感结果生成图片
if sentiment_result['label'] == 'positive':
generator = pipeline('text-to-image', model='damo/multi-modal_diffusion_text-to-image_chinese-base')
image_result = generator('一个开心的笑脸')
print(image_result)
else:
generator = pipeline('text-to-image', model='damo/multi-modal_diffusion_text-to-image_chinese-base')
image_result = generator('一个悲伤的脸')
print(image_result)
from modelscope.pipelines import pipeline
classifier = pipeline('text-classification', model='damo/nlp_structbert_text-classification_chinese-base')
result = classifier('我喜欢吃苹果')
# 过滤结果
filtered_result = [item for item in result if item['score'] > 0.8]
print(filtered_result)
pip install modelscope[evaluation]
from modelscope.evaluation import evaluate
evaluator = evaluate('text-classification', model='damo/nlp_structbert_text-classification_chinese-base', dataset='my_dataset')
result = evaluator.evaluate()
print(result)
from modelscope.evaluation import evaluate
evaluator = evaluate('image-classification', model='damo/cv_resnet50_image-classification_chinese-base', dataset='my_dataset')
result = evaluator.evaluate()
print(result)
from modelscope.pipelines import pipeline
# 文生图
text_to_image = pipeline('text-to-image', model='damo/multi-modal_diffusion_text-to-image_chinese-base')
image = text_to_image('一只可爱的小猫')
# 图片描述
image_to_text = pipeline('image-to-text', model='damo/multi-modal_vit-gpt3_image-to-text_chinese-base')
description = image_to_text(image)
print(description)
📈 公众号代运营的现状与核心矛盾这两年公众号代运营市场真是热闹,大小公司像雨后春笋一样冒出来。打开百度搜一搜,能出来好几页服务商,价格从几千到几万不等。可你真要挑一家靠谱的,难!我见过不少企业踩
📝 AI 写作工具的 “便捷性” 背后的陷阱现在打开手机应用商店,输入 “论文助手” 能跳出几十款 AI 写作工具。这些工具标榜 “一键生成大纲”“秒写文献综述”,学生群体用得那叫一个顺手。但你有没
你辛辛苦苦用 AI 工具写了篇稿子,结果被平台的 AI 检测拦在门外。提示说 “内容存在明显 AI 生成痕迹”,不仅发不出去,有的平台还会给账号扣分。更头疼的是,明明自己花了不少心思修改,怎么还是逃不
?科学教学模式:从理论到实战的闭环培养 学习猿地的课程体系设计有个很明显的特点,就是完全对标企业用人需求。他们不是简单地把大学课本内容搬上网,而是联合行业一线大牛共同研发课程。像大数据开发、Web 前
?️ Mentioned AI:让品牌社交监测告别 “盲人摸象” 在社交媒体营销越来越卷的当下,品牌主们常常面临这样的困惑:昨天刚推的新品话题,到底在哪些平台掀起了水花?用户评论里那些弯弯绕绕的话,到
?全球汽车供应链数据大揭秘:盖世汽车的独家秘籍 在当今全球化的汽车产业格局下,获取准确、全面的全球汽车供应链数据,对汽车企业、零部件供应商、投资者以及相关研究机构来说,那可是至关重要的事儿。为啥这么说
? 2025 亚马逊运营必备:CopyMonkey.ai 生成标题卖点,多语言多市场支持 作为深耕亚马逊运营多年的老司机,我一直在寻找能真正提升效率的工具。最近体验了 CopyMonkey.ai,这款
? Machined.ai:OpenAI 模型赋能,企业营销与 SEO 优化的革新利器 在数字化营销浪潮中,内容创作和 SEO 优化始终是企业提升竞争力的核心环节。随着人工智能技术的飞速发展,Mach