本地部署DeepSeek开源多模态大模型Janus-Pro-7B实操
本地部署DeepSeek开源多模态大模型Janus-Pro-7B实操
Janus-Pro-7B介绍
Janus-Pro-7B 是由 DeepSeek 开发的多模态 AI 模型,它在理解和生成方面取得了显著的进步。这意味着它不仅可以处理文本,还可以处理图像等其他模态的信息。
模型主要特点:Permalink
统一的架构: Janus-Pro 采用单一 transformer 架构来处理文本和图像信息,实现了真正的多模态理解和生成。
解耦的视觉编码: 为了更好地平衡理解和生成任务,Janus-Pro 将视觉编码解耦为独立的路径,提高了模型的灵活性和性能。
强大的性能: 在多个基准测试中,Janus-Pro 的性能超越了之前的统一模型,甚至可以与特定任务的模型相媲美。
开源: Janus-Pro-7B 是开源的,这意味着研究人员和开发者可以自由地访问和使用它,推动 AI 领域的创新。
具体来说,Janus-Pro-7B 有以下优势:
图像理解: 能够准确地识别和理解图像中的对象、场景和关系。
图像生成: 可以根据文本描述生成高质量的图像,甚至可以进行图像编辑和转换。
文本生成: 可以生成流畅、连贯的文本,例如故事、诗歌、代码等。
多模态推理: 可以结合文本和图像信息进行推理,例如根据图像内容回答问题,或者根据文本描述生成图像。
与其他模型的比较:
超越 DALL-E 3 和 Stable Diffusion: 在 GenEval 和 DPG-Bench 等基准测试中,Janus-Pro-7B 的性能优于 OpenAI 的 DALL-E 3 和 Stability AI 的 Stable Diffusion。
基于 DeepSeek-LLM: Janus-Pro 建立在 DeepSeek-LLM-1.5b-base/DeepSeek-LLM-7b-base 的基础上,并对其进行了多模态扩展。
应用场景:
Janus-Pro-7B 具有广泛的应用场景,例如:
内容创作: 可以帮助用户生成高质量的图像、文本和其他多媒体内容。
教育: 可以用于创建交互式学习体验,例如根据文本描述生成图像,或者根据图像内容回答问题。
客户服务: 可以用于构建更智能的聊天机器人,能够理解和回应用户的多模态查询。
辅助设计: 可以帮助设计师生成创意概念,并将其转化为可视化原型
1 启动Anaconda环境


2 进入命令环境
conda create -n myenv python=3.10 -ygit clone https://github.com/deepseek-ai/Janus.gitcd Januspip install -e .pip install webencodings beautifulsoup4 tinycss2pip install -e .[gradio]pip install 'pexpect>4.3'python demo/app_januspro.py
3 遇到默认配置下C盘磁盘空间不足问题
(myenvp) C:\Users\Administrator>python demo/app_januspro.py
python: can't open file 'C:\\Users\\Administrator\\demo\\app_januspro.py': [Errno 2] No such file or directory(myenvp) C:\Users\Administrator>e:(myenvp) E:\>cd ai(myenvp) E:\AI>cd Janus(myenvp) E:\AI\Janus>dir驱动器 E 中的卷是 chia-12T-1卷的序列号是 0AF0-159BE:\AI\Janus 的目录2025/01/31 12:26 <DIR> .
2025/01/30 00:53 <DIR> ..
2025/01/30 00:53 115 .gitattributes
2025/01/30 00:53 7,301 .gitignore
2025/01/30 01:47 <DIR> .gradio
2025/01/30 01:18 <DIR> .locks
2025/01/31 12:26 0 4.3'
2025/01/30 00:53 <DIR> demo
2025/01/30 00:53 4,515 generation_inference.py
2025/01/30 00:53 <DIR> images
2025/01/30 00:53 2,642 inference.py
2025/01/30 00:53 5,188 interactivechat.py
2025/01/30 01:04 <DIR> janus
2025/01/31 12:25 <DIR> janus.egg-info
2025/01/30 00:53 2,846,268 janus_pro_tech_report.pdf
2025/01/30 00:53 1,065 LICENSE-CODE
2025/01/30 00:53 13,718 LICENSE-MODEL
2025/01/30 00:53 3,069 Makefile
2025/01/30 01:47 <DIR> models--deepseek-ai--Janus-Pro-7B
2025/01/30 00:53 1,111 pyproject.toml
2025/01/30 00:53 26,742 README.md
2025/01/30 00:53 278 requirements.txt
2025/01/30 01:18 1 version.txt14 个文件 2,912,013 字节9 个目录 9,387,683,614,720 可用字节
3.1 设置HF_DATASETS_CACHE环境变量没解决问题
(myenvp) E:\AI\Janus>set HF_DATASETS_CACHE="E:\AI\Janus"(myenvp) E:\AI\Janus>python demo/app_januspro.py
Python version is above 3.10, patching the collections module.
D:\anaconda3\envs\myenvp\lib\site-packages\transformers\models\auto\image_processing_auto.py:590: FutureWarning: The image_processor_class argument is deprecated and will be removed in v4.42. Please use `slow_image_processor_class`, or `fast_image_processor_class` insteadwarnings.warn(
Downloading shards: 0%| | 0/2 [00:00<?, ?it/s]D:\anaconda3\envs\myenvp\lib\site-packages\huggingface_hub\file_download.py:651: UserWarning: Not enough free disk space to download the file. The expected file size is: 9988.18 MB. The target location C:\Users\Administrator\.cache\huggingface\hub\models--deepseek-ai--Janus-Pro-7B\blobs only has 8154.37 MB free disk space.warnings.warn(
pytorch_model-00001-of-00002.bin: 37%|███████████████▉ | 3.71G/9.99G [00:05<02:38, 39.5MB/s]
Downloading shards: 0%| | 0/2 [00:06<?, ?it/s]
Traceback (most recent call last):File "E:\AI\Janus\demo\app_januspro.py", line 19, in <module>vl_gpt = AutoModelForCausalLM.from_pretrained(model_path,File "D:\anaconda3\envs\myenvp\lib\site-packages\transformers\models\auto\auto_factory.py", line 564, in from_pretrainedreturn model_class.from_pretrained(File "D:\anaconda3\envs\myenvp\lib\site-packages\transformers\modeling_utils.py", line 3944, in from_pretrainedresolved_archive_file, sharded_metadata = get_checkpoint_shard_files(File "D:\anaconda3\envs\myenvp\lib\site-packages\transformers\utils\hub.py", line 1098, in get_checkpoint_shard_filescached_filename = cached_file(File "D:\anaconda3\envs\myenvp\lib\site-packages\transformers\utils\hub.py", line 403, in cached_fileresolved_file = hf_hub_download(File "D:\anaconda3\envs\myenvp\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fnreturn fn(*args, **kwargs)File "D:\anaconda3\envs\myenvp\lib\site-packages\huggingface_hub\file_download.py", line 860, in hf_hub_downloadreturn _hf_hub_download_to_cache_dir(File "D:\anaconda3\envs\myenvp\lib\site-packages\huggingface_hub\file_download.py", line 1009, in _hf_hub_download_to_cache_dir_download_to_tmp_and_move(File "D:\anaconda3\envs\myenvp\lib\site-packages\huggingface_hub\file_download.py", line 1543, in _download_to_tmp_and_movehttp_get(File "D:\anaconda3\envs\myenvp\lib\site-packages\huggingface_hub\file_download.py", line 452, in http_getfor chunk in r.iter_content(chunk_size=constants.DOWNLOAD_CHUNK_SIZE):File "D:\anaconda3\envs\myenvp\lib\site-packages\requests\models.py", line 820, in generateyield from self.raw.stream(chunk_size, decode_content=True)File "D:\anaconda3\envs\myenvp\lib\site-packages\urllib3\response.py", line 1066, in streamdata = self.read(amt=amt, decode_content=decode_content)File "D:\anaconda3\envs\myenvp\lib\site-packages\urllib3\response.py", line 955, in readdata = self._raw_read(amt)File "D:\anaconda3\envs\myenvp\lib\site-packages\urllib3\response.py", line 879, in _raw_readdata = self._fp_read(amt, read1=read1) if not fp_closed else b""File "D:\anaconda3\envs\myenvp\lib\site-packages\urllib3\response.py", line 862, in _fp_readreturn self._fp.read(amt) if amt is not None else self._fp.read()File "D:\anaconda3\envs\myenvp\lib\http\client.py", line 466, in reads = self.fp.read(amt)File "D:\anaconda3\envs\myenvp\lib\socket.py", line 717, in readintoreturn self._sock.recv_into(b)File "D:\anaconda3\envs\myenvp\lib\ssl.py", line 1307, in recv_intoreturn self.read(nbytes, buffer)File "D:\anaconda3\envs\myenvp\lib\ssl.py", line 1163, in readreturn self._sslobj.read(len, buffer)
KeyboardInterrupt
^C
3.2 设置环境变量HF_HOME解决问题
(myenvp) E:\AI\Janus>set HF_HOME=E:\AI\Janus(myenvp) E:\AI\Janus>python demo/app_januspro.py
Python version is above 3.10, patching the collections module.
D:\anaconda3\envs\myenvp\lib\site-packages\transformers\models\auto\image_processing_auto.py:590: FutureWarning: The image_processor_class argument is deprecated and will be removed in v4.42. Please use `slow_image_processor_class`, or `fast_image_processor_class` insteadwarnings.warn(
config.json: 100%|████████████████████████████████████████████████████████████████████████| 1.28k/1.28k [00:00<?, ?B/s]
pytorch_model.bin.index.json: 100%|███████████████████████████████████████████████| 89.0k/89.0k [00:00<00:00, 1.67MB/s]
model.safetensors.index.json: 100%|███████████████████████████████████████████████| 92.8k/92.8k [00:00<00:00, 2.99MB/s]
pytorch_model-00001-of-00002.bin: 15%|██████▌ | 1.53G/9.99G [00:37<03:26, 41.0MB/s]
Downloading shards: 0%| | 0/2 [00:37<?, ?it/s]
Traceback (most recent call last):File "E:\AI\Janus\demo\app_januspro.py", line 19, in <module>vl_gpt = AutoModelForCausalLM.from_pretrained(model_path,File "D:\anaconda3\envs\myenvp\lib\site-packages\transformers\models\auto\auto_factory.py", line 564, in from_pretrainedreturn model_class.from_pretrained(File "D:\anaconda3\envs\myenvp\lib\site-packages\transformers\modeling_utils.py", line 3944, in from_pretrainedresolved_archive_file, sharded_metadata = get_checkpoint_shard_files(File "D:\anaconda3\envs\myenvp\lib\site-packages\transformers\utils\hub.py", line 1098, in get_checkpoint_shard_filescached_filename = cached_file(File "D:\anaconda3\envs\myenvp\lib\site-packages\transformers\utils\hub.py", line 403, in cached_fileresolved_file = hf_hub_download(File "D:\anaconda3\envs\myenvp\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fnreturn fn(*args, **kwargs)File "D:\anaconda3\envs\myenvp\lib\site-packages\huggingface_hub\file_download.py", line 860, in hf_hub_downloadreturn _hf_hub_download_to_cache_dir(File "D:\anaconda3\envs\myenvp\lib\site-packages\huggingface_hub\file_download.py", line 1009, in _hf_hub_download_to_cache_dir_download_to_tmp_and_move(File "D:\anaconda3\envs\myenvp\lib\site-packages\huggingface_hub\file_download.py", line 1543, in _download_to_tmp_and_movehttp_get(File "D:\anaconda3\envs\myenvp\lib\site-packages\huggingface_hub\file_download.py", line 452, in http_getfor chunk in r.iter_content(chunk_size=constants.DOWNLOAD_CHUNK_SIZE):File "D:\anaconda3\envs\myenvp\lib\site-packages\requests\models.py", line 820, in generateyield from self.raw.stream(chunk_size, decode_content=True)File "D:\anaconda3\envs\myenvp\lib\site-packages\urllib3\response.py", line 1066, in streamdata = self.read(amt=amt, decode_content=decode_content)File "D:\anaconda3\envs\myenvp\lib\site-packages\urllib3\response.py", line 955, in readdata = self._raw_read(amt)File "D:\anaconda3\envs\myenvp\lib\site-packages\urllib3\response.py", line 879, in _raw_readdata = self._fp_read(amt, read1=read1) if not fp_closed else b""File "D:\anaconda3\envs\myenvp\lib\site-packages\urllib3\response.py", line 862, in _fp_readreturn self._fp.read(amt) if amt is not None else self._fp.read()File "D:\anaconda3\envs\myenvp\lib\http\client.py", line 466, in reads = self.fp.read(amt)File "D:\anaconda3\envs\myenvp\lib\socket.py", line 717, in readintoreturn self._sock.recv_into(b)File "D:\anaconda3\envs\myenvp\lib\ssl.py", line 1307, in recv_intoreturn self.read(nbytes, buffer)File "D:\anaconda3\envs\myenvp\lib\ssl.py", line 1163, in readreturn self._sslobj.read(len, buffer)
KeyboardInterrupt
^C
3.3 如果没下载好模型文件忽略这步
如果之前已经下载好模型文件,将models–deepseek-ai–Janus-Pro-7B目录拷贝到E:\AI\Janus\hub
(myenvp) E:\AI\Janus>python demo/app_januspro.py
Python version is above 3.10, patching the collections module.
D:\anaconda3\envs\myenvp\lib\site-packages\transformers\models\auto\image_processing_auto.py:590: FutureWarning: The image_processor_class argument is deprecated and will be removed in v4.42. Please use `slow_image_processor_class`, or `fast_image_processor_class` insteadwarnings.warn(
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████| 2/2 [00:44<00:00, 22.13s/it]
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.48, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
You are using the default legacy behaviour of the <class 'transformers.models.llama.tokenization_llama_fast.LlamaTokenizerFast'>. This is expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it means, and thoroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565 - if you loaded a llama tokenizer from a GGUF file you can ignore this message.
Some kwargs in processor config are unused and will not have any effect: ignore_id, num_image_tokens, add_special_token, mask_prompt, image_tag, sft_format.
Running on local URL: http://127.0.0.1:7860
IMPORTANT: You are using gradio version 3.48.0, however version 4.44.1 is available, please upgrade.
--------
Running on public URL: https://cf6180260c7448cc2b.gradio.liveThis share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)
Keyboard interruption in main thread... closing server.
Traceback (most recent call last):File "D:\anaconda3\envs\myenvp\lib\site-packages\gradio\blocks.py", line 2361, in block_threadtime.sleep(0.1)
KeyboardInterruptDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "E:\AI\Janus\demo\app_januspro.py", line 244, in <module>demo.launch(share=True)File "D:\anaconda3\envs\myenvp\lib\site-packages\gradio\blocks.py", line 2266, in launchself.block_thread()File "D:\anaconda3\envs\myenvp\lib\site-packages\gradio\blocks.py", line 2365, in block_threadself.server.close()File "D:\anaconda3\envs\myenvp\lib\site-packages\gradio\networking.py", line 75, in closeself.thread.join()File "D:\anaconda3\envs\myenvp\lib\threading.py", line 1096, in joinself._wait_for_tstate_lock()File "D:\anaconda3\envs\myenvp\lib\threading.py", line 1116, in _wait_for_tstate_lockif lock.acquire(block, timeout):
KeyboardInterrupt
Killing tunnel 127.0.0.1:7860 <> https://cf6180260c7448cc2b.gradio.live
^C
4 强制使用显卡
(myenvp) E:\AI\Janus>python demo/app_januspro.py --device cuda
Python version is above 3.10, patching the collections module.
D:\anaconda3\envs\myenvp\lib\site-packages\transformers\models\auto\image_processing_auto.py:590: FutureWarning: The image_processor_class argument is deprecated and will be removed in v4.42. Please use `slow_image_processor_class`, or `fast_image_processor_class` insteadwarnings.warn(
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████| 2/2 [00:06<00:00, 3.29s/it]
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.48, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
You are using the default legacy behaviour of the <class 'transformers.models.llama.tokenization_llama_fast.LlamaTokenizerFast'>. This is expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it means, and thoroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565 - if you loaded a llama tokenizer from a GGUF file you can ignore this message.
Some kwargs in processor config are unused and will not have any effect: num_image_tokens, image_tag, ignore_id, mask_prompt, sft_format, add_special_token.
Running on local URL: http://127.0.0.1:7860
IMPORTANT: You are using gradio version 3.48.0, however version 4.44.1 is available, please upgrade.
--------
Running on public URL: https://342ecb20d5120e7d8c.gradio.liveThis share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)
Keyboard interruption in main thread... closing server.
Traceback (most recent call last):File "D:\anaconda3\envs\myenvp\lib\site-packages\gradio\blocks.py", line 2361, in block_threadtime.sleep(0.1)
KeyboardInterruptDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "E:\AI\Janus\demo\app_januspro.py", line 244, in <module>demo.launch(share=True)File "D:\anaconda3\envs\myenvp\lib\site-packages\gradio\blocks.py", line 2266, in launchself.block_thread()File "D:\anaconda3\envs\myenvp\lib\site-packages\gradio\blocks.py", line 2365, in block_threadself.server.close()File "D:\anaconda3\envs\myenvp\lib\site-packages\gradio\networking.py", line 75, in closeself.thread.join()File "D:\anaconda3\envs\myenvp\lib\threading.py", line 1096, in joinself._wait_for_tstate_lock()File "D:\anaconda3\envs\myenvp\lib\threading.py", line 1116, in _wait_for_tstate_lockif lock.acquire(block, timeout):
KeyboardInterrupt
Killing tunnel 127.0.0.1:7860 <> https://342ecb20d5120e7d8c.gradio.live
^C
5 部分部署过程
(myenvp) E:\AI\Janus>pip install -e .
Obtaining file:///E:/AI/JanusInstalling build dependencies ... doneChecking if build backend supports build_editable ... doneGetting requirements to build editable ... donePreparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: torch>=2.0.1 in d:\anaconda3\envs\myenvp\lib\site-packages (from janus==1.0.0) (2.5.1+cu121)
Requirement already satisfied: transformers>=4.38.2 in d:\anaconda3\envs\myenvp\lib\site-packages (from janus==1.0.0) (4.48.1)
Requirement already satisfied: timm>=0.9.16 in d:\anaconda3\envs\myenvp\lib\site-packages (from janus==1.0.0) (1.0.14)
Requirement already satisfied: accelerate in d:\anaconda3\envs\myenvp\lib\site-packages (from janus==1.0.0) (1.3.0)
Requirement already satisfied: sentencepiece in d:\anaconda3\envs\myenvp\lib\site-packages (from janus==1.0.0) (0.1.96)
Requirement already satisfied: attrdict in d:\anaconda3\envs\myenvp\lib\site-packages (from janus==1.0.0) (2.0.1)
Requirement already satisfied: einops in d:\anaconda3\envs\myenvp\lib\site-packages (from janus==1.0.0) (0.8.0)
Requirement already satisfied: torchvision in d:\anaconda3\envs\myenvp\lib\site-packages (from timm>=0.9.16->janus==1.0.0) (0.20.1+cu121)
Requirement already satisfied: pyyaml in d:\anaconda3\envs\myenvp\lib\site-packages (from timm>=0.9.16->janus==1.0.0) (6.0.2)
Requirement already satisfied: huggingface_hub in d:\anaconda3\envs\myenvp\lib\site-packages (from timm>=0.9.16->janus==1.0.0) (0.28.0)
Requirement already satisfied: safetensors in d:\anaconda3\envs\myenvp\lib\site-packages (from timm>=0.9.16->janus==1.0.0) (0.5.2)
Requirement already satisfied: filelock in d:\anaconda3\envs\myenvp\lib\site-packages (from torch>=2.0.1->janus==1.0.0) (3.17.0)
Requirement already satisfied: typing-extensions>=4.8.0 in d:\anaconda3\envs\myenvp\lib\site-packages (from torch>=2.0.1->janus==1.0.0) (4.12.2)
Requirement already satisfied: networkx in d:\anaconda3\envs\myenvp\lib\site-packages (from torch>=2.0.1->janus==1.0.0) (3.4.2)
Requirement already satisfied: jinja2 in d:\anaconda3\envs\myenvp\lib\site-packages (from torch>=2.0.1->janus==1.0.0) (3.1.5)
Requirement already satisfied: fsspec in d:\anaconda3\envs\myenvp\lib\site-packages (from torch>=2.0.1->janus==1.0.0) (2024.12.0)
Requirement already satisfied: sympy==1.13.1 in d:\anaconda3\envs\myenvp\lib\site-packages (from torch>=2.0.1->janus==1.0.0) (1.13.1)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in d:\anaconda3\envs\myenvp\lib\site-packages (from sympy==1.13.1->torch>=2.0.1->janus==1.0.0) (1.3.0)
Requirement already satisfied: numpy>=1.17 in d:\anaconda3\envs\myenvp\lib\site-packages (from transformers>=4.38.2->janus==1.0.0) (1.26.4)
Requirement already satisfied: packaging>=20.0 in d:\anaconda3\envs\myenvp\lib\site-packages (from transformers>=4.38.2->janus==1.0.0) (24.2)
Requirement already satisfied: regex!=2019.12.17 in d:\anaconda3\envs\myenvp\lib\site-packages (from transformers>=4.38.2->janus==1.0.0) (2024.11.6)
Requirement already satisfied: requests in d:\anaconda3\envs\myenvp\lib\site-packages (from transformers>=4.38.2->janus==1.0.0) (2.32.3)
Requirement already satisfied: tokenizers<0.22,>=0.21 in d:\anaconda3\envs\myenvp\lib\site-packages (from transformers>=4.38.2->janus==1.0.0) (0.21.0)
Requirement already satisfied: tqdm>=4.27 in d:\anaconda3\envs\myenvp\lib\site-packages (from transformers>=4.38.2->janus==1.0.0) (4.64.0)
Requirement already satisfied: psutil in d:\anaconda3\envs\myenvp\lib\site-packages (from accelerate->janus==1.0.0) (6.1.1)
Requirement already satisfied: six in d:\anaconda3\envs\myenvp\lib\site-packages (from attrdict->janus==1.0.0) (1.17.0)
Requirement already satisfied: colorama in d:\anaconda3\envs\myenvp\lib\site-packages (from tqdm>=4.27->transformers>=4.38.2->janus==1.0.0) (0.4.5)
Requirement already satisfied: MarkupSafe>=2.0 in d:\anaconda3\envs\myenvp\lib\site-packages (from jinja2->torch>=2.0.1->janus==1.0.0) (2.1.5)
Requirement already satisfied: charset-normalizer<4,>=2 in d:\anaconda3\envs\myenvp\lib\site-packages (from requests->transformers>=4.38.2->janus==1.0.0) (3.4.1)
Requirement already satisfied: idna<4,>=2.5 in d:\anaconda3\envs\myenvp\lib\site-packages (from requests->transformers>=4.38.2->janus==1.0.0) (3.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in d:\anaconda3\envs\myenvp\lib\site-packages (from requests->transformers>=4.38.2->janus==1.0.0) (2.3.0)
Requirement already satisfied: certifi>=2017.4.17 in d:\anaconda3\envs\myenvp\lib\site-packages (from requests->transformers>=4.38.2->janus==1.0.0) (2024.12.14)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in d:\anaconda3\envs\myenvp\lib\site-packages (from torchvision->timm>=0.9.16->janus==1.0.0) (10.4.0)
Building wheels for collected packages: janusBuilding editable for janus (pyproject.toml) ... doneCreated wheel for janus: filename=janus-1.0.0-0.editable-py3-none-any.whl size=16196 sha256=cdb0ebb0c36046bf768a84cbf9208824eadb31fadea888f3b6ff102de576f743Stored in directory: C:\Users\Administrator\AppData\Local\Temp\pip-ephem-wheel-cache-dhnej7iy\wheels\e4\87\ba\dd6e5c70086c786d25bcd3e6bddaeb7c46f5ae69dc25ea8be0
Successfully built janus
Installing collected packages: janusAttempting uninstall: janusFound existing installation: janus 1.0.0Uninstalling janus-1.0.0:Successfully uninstalled janus-1.0.0
Successfully installed janus-1.0.0(myenvp) E:\AI\Janus>pip install webencodings beautifulsoup4 tinycss2
Requirement already satisfied: webencodings in d:\anaconda3\envs\myenvp\lib\site-packages (0.5.1)
Requirement already satisfied: beautifulsoup4 in d:\anaconda3\envs\myenvp\lib\site-packages (4.12.3)
Requirement already satisfied: tinycss2 in d:\anaconda3\envs\myenvp\lib\site-packages (1.4.0)
Requirement already satisfied: soupsieve>1.2 in d:\anaconda3\envs\myenvp\lib\site-packages (from beautifulsoup4) (2.6)(myenvp) E:\AI\Janus>pip install 'pexpect>4.3'
ERROR: Invalid requirement: "'pexpect": Expected package name at the start of dependency specifier'pexpect^(myenvp) E:\AI\Janus>pip install 'pexpect>4.3'
ERROR: Invalid requirement: "'pexpect": Expected package name at the start of dependency specifier'pexpect^(myenvp) E:\AI\Janus>pip install "pexpect>4.3"
Requirement already satisfied: pexpect>4.3 in d:\anaconda3\envs\myenvp\lib\site-packages (4.9.0)
Requirement already satisfied: ptyprocess>=0.5 in d:\anaconda3\envs\myenvp\lib\site-packages (from pexpect>4.3) (0.7.0)(myenvp) E:\AI\Janus>python demo/app_januspro.py
Python version is above 3.10, patching the collections module.
D:\anaconda3\envs\myenvp\lib\site-packages\transformers\models\auto\image_processing_auto.py:590: FutureWarning: The image_processor_class argument is deprecated and will be removed in v4.42. Please use `slow_image_processor_class`, or `fast_image_processor_class` insteadwarnings.warn(
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████| 2/2 [00:06<00:00, 3.25s/it]
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.48, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
You are using the default legacy behaviour of the <class 'transformers.models.llama.tokenization_llama_fast.LlamaTokenizerFast'>. This is expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it means, and thoroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565 - if you loaded a llama tokenizer from a GGUF file you can ignore this message.
Some kwargs in processor config are unused and will not have any effect: ignore_id, sft_format, image_tag, num_image_tokens, mask_prompt, add_special_token.
Running on local URL: http://127.0.0.1:7860
IMPORTANT: You are using gradio version 3.48.0, however version 4.44.1 is available, please upgrade.
--------
Running on public URL: https://b0590adff3d54b2255.gradio.liveThis share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)
Keyboard interruption in main thread... closing server.
Killing tunnel 127.0.0.1:7860 <> https://b0590adff3d54b2255.gradio.live(myenvp) E:\AI\Janus>python demo/app_januspro.py --device cuda
Python version is above 3.10, patching the collections module.
D:\anaconda3\envs\myenvp\lib\site-packages\transformers\models\auto\image_processing_auto.py:590: FutureWarning: The image_processor_class argument is deprecated and will be removed in v4.42. Please use `slow_image_processor_class`, or `fast_image_processor_class` insteadwarnings.warn(
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████| 2/2 [00:06<00:00, 3.05s/it]
Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.48, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
You are using the default legacy behaviour of the <class 'transformers.models.llama.tokenization_llama_fast.LlamaTokenizerFast'>. This is expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it means, and thoroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565 - if you loaded a llama tokenizer from a GGUF file you can ignore this message.
Some kwargs in processor config are unused and will not have any effect: image_tag, sft_format, ignore_id, add_special_token, num_image_tokens, mask_prompt.
Running on local URL: http://127.0.0.1:7860
IMPORTANT: You are using gradio version 3.48.0, however version 4.44.1 is available, please upgrade.
--------
Running on public URL: https://72d4294c2d37f91dc8.gradio.liveThis share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)
6 使用效果
6.1 识别图片


6.2 文生图

6.2.1 浣熊师父身穿滴水服装,扮演街头歹徒。
Master shifu racoon wearing drip attire as a street gangster.





6.2.2 美丽女孩的脸
The face of a beautiful girl





6.2.3 丛林中的宇航员,冷色调,柔和的色彩,细节丰富,8k
Astronaut in a jungle, cold color palette, muted colors, detailed, 8k





6.2.4 反光面上的一杯红酒。
A glass of red wine on a reflective surface.





6.2.5 一只可爱又迷人的小狐狸,有着大大的棕色眼睛,背景中秋叶迷人,永恒、蓬松、闪亮的鬃毛、花瓣、童话般的氛围,虚幻引擎 5 和 Octane 渲染器,细节丰富,具有照片级真实感,具有电影感,色彩自然。
A cute and adorable baby fox with big brown eyes, autumn leaves in the background enchanting,immortal,fluffy, shiny mane,Petals,fairyism,unreal engine 5 and Octane Render,highly detailed, photorealistic, cinematic, natural colors.





6.2.6 这幅画中的眼睛设计精巧,背景为圆形,饰有华丽的漩涡图案,既有现实主义的色彩,也有超现实主义的色彩。画中焦点是一只鲜艳的蓝色虹膜,周围环绕着从瞳孔向外辐射的细纹,营造出深度和强度。睫毛又长又黑,在周围的皮肤上投下微妙的阴影,皮肤看起来很光滑,但略带纹理,仿佛随着时间的流逝而老化或风化。眼睛上方有一个类似古典建筑的石头结构,为构图增添了神秘感和永恒的优雅。这一建筑元素与周围的有机曲线形成鲜明而和谐的对比。眼睛下方是另一个让人联想到巴洛克艺术的装饰图案,进一步增强了每个精心制作的细节所蕴含的整体永恒感。总体而言,氛围散发着一种神秘的气氛,与暗示永恒的元素无缝交织在一起,通过现实纹理和超现实艺术的并置实现。每一个组成部分——从吸引眼球的复杂设计到上方古老的石块——都以独特的方式创造出充满神秘魅力的视觉盛宴。
The image features an intricately designed eye set against a circular backdrop adorned with ornate swirl patterns that evoke both realism and surrealism. At the center of attention is a strikingly vivid blue iris surrounded by delicate veins radiating outward from the pupil to create depth and intensity. The eyelashes are long and dark, casting subtle shadows on the skin around them which appears smooth yet slightly textured as if aged or weathered over time.
Above the eye, there’s a stone-like structure resembling part of classical architecture, adding layers of mystery and timeless elegance to the composition. This architectural element contrasts sharply but harmoniously with the organic curves surrounding it. Below the eye lies another decorative motif reminiscent of baroque artistry, further enhancing the overall sense of eternity encapsulated within each meticulously crafted detail.
Overall, the atmosphere exudes a mysterious aura intertwined seamlessly with elements suggesting timelessness, achieved through the juxtaposition of realistic textures and surreal artistic flourishes. Each component—from the intricate designs framing the eye to the ancient-looking stone piece above—contributes uniquely towards creating a visually captivating tableau imbued with enigmatic allure.





相关文章:
本地部署DeepSeek开源多模态大模型Janus-Pro-7B实操
本地部署DeepSeek开源多模态大模型Janus-Pro-7B实操 Janus-Pro-7B介绍 Janus-Pro-7B 是由 DeepSeek 开发的多模态 AI 模型,它在理解和生成方面取得了显著的进步。这意味着它不仅可以处理文本,还可以处理图像等其他模态的信息。 模型主要特点:Permalink…...
ITS290F Human Computer Interaction
ITS290F Human Computer Interaction & User Experience Design Lab 1. Introduction to CodePen What you’ll learn in this lab: • Understanding CodePen • Creating a front-end page • Using Google form to submit your lab work CodePen is a cloud-based in…...
【详细教程】如何在Mac部署Deepseek R1?
DeepSeek是目前最火的国产大模型,官方App用户太多服务经常出现卡顿,部署一个本地DeepSeek R1可以方便使用。 1.系统最低要求 macOS 11 Big Sur 或更新 2.下载ollama https://ollama.com/ 3.安装DeepSeek R1 打开终端 运行命令 ollama run deepseek-…...
DeepSeek能下围棋吗?(续)
休息了一下,接着琢磨围棋,其实前面一篇里的规则有个漏洞的,就是邻居关系定义有问题,先回顾一下游戏规则: 游戏规则 定义: 1.数字对,是指两个1到9之间的整数组成的有序集合。可与记为(m,n)&…...
网络安全技术简介
网络安全技术简介 随着信息技术的迅猛发展,互联网已经成为人们日常生活和工作中不可或缺的一部分。与此同时,网络安全问题也日益凸显,成为全球关注的焦点。无论是个人隐私泄露、企业数据被盗取还是国家信息安全受到威胁,都与网络…...
Keepalived高可用集群企业应用实例一
一、实现master/slave的keepalived单主架构 1.master配置 global_defs { notification_email { 2676401238qq.com } notification_email_from keepalivedKA1.xiao.org smtp_server 127.0.0.1 smtp_connect_timeout 30 router_id ka1.xiao.org vrrp_skip_check_adv_addr vrr…...
愿景:做机器视觉行业的颠覆者
一个愿景,两场战斗,专注制胜。 一个愿景:做机器视觉行业的颠覆者。 我给自己创业,立一个大的愿景:做机器视觉行业的颠覆者。 两场战斗:无监督-大模型 上半场,无监督。2025-2030,共五…...
【产品经理学习案例——AI翻译棒出海业务】
前言: 本文主要讲述了硬件产品在出海过程中,翻译质量、翻译速度和本地化落地策略是硬件产品规划需要考虑的核心因素。针对不同国家,需要优化翻译质量和算法,关注市场需求和文化差异,以便更好地满足当地用户的需求。同…...
算法总结-数组/字符串
文章目录 1.合并两个有序数组1.答案2.思路 2.移除元素1.答案2.思路 3.删除有序数组中的重复项 II1.答案2.思路 4.多数元素1.答案2.思路 5.轮转数组1.答案2.思路 6.买卖股票的最佳时机1.答案2.思路 7.买卖股票的最佳时机 II1.答案2.思路 8.跳跃游戏1.答案2.思路 9.H 指数1.答案2…...
被裁与人生的意义--春节随想
还有两个月就要被迫离开工作了十多年的公司了,不过有幸安安稳稳的过了一个春节,很知足! 我是最后一批要离开的,一百多号同事都没“活到”蛇年。看着一批批仁人志士被“秋后斩首”,马上轮到我们十来个,个中滋味很难言清…...
Linux解决输入法卡死问题
说明:在Ubuntu系统中,如果您需要重启输入法服务(比如fcitx或ibus),您可以按照以下步骤操作。这些步骤适用于大多数基于Ubuntu的发行版,例如Ubuntu、Linux Mint等。 一、重启Fcitx输入法服务 1、使用Ctrl …...
2501,编写dll
DLL的优点 简单的说,dll有以下几个优点: 1)节省内存.同一个软件模块,若是源码重用,则会在不同可执行程序中编译,同时运行这些exe时,会在内存中重复加载这些模块的二进制码. 如果使用dll,则只在内存中加载一次,所有使用该dll的进程会共享此块内存(当然,每个进程会复制一份的d…...
4-图像梯度计算
文章目录 4.图像梯度计算(1)Sobel算子(2)梯度计算方法(3)Scharr与Laplacian算子4.图像梯度计算 (1)Sobel算子 图像梯度-Sobel算子 Sobel算子是一种经典的图像边缘检测算子,广泛应用于图像处理和计算机视觉领域。以下是关于Sobel算子的详细介绍: 基本原理 Sobel算子…...
【算法设计与分析】实验5:贪心算法—装载及背包问题
目录 一、实验目的 二、实验环境 三、实验内容 四、核心代码 五、记录与处理 六、思考与总结 七、完整报告和成果文件提取链接 一、实验目的 掌握贪心算法求解问题的思想;针对不同问题,会利用贪心算法进行问题建模、求解以及时间复杂度分析&#x…...
从0开始使用面对对象C语言搭建一个基于OLED的图形显示框架(协议层封装)
目录 协议层设计,以IIC为例子 关于软硬件IIC 设计的一些原则 完成协议层的抽象 刨析我们的原理 如何完成我们的抽象 插入几个C语言小技巧 完成软件IIC通信 开始我们的IIC通信 结束我们的IIC通信 发送一个字节 (重要)完成命令传递和…...
【自学笔记】计算机网络的重点知识点-持续更新
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 计算机网络重点知识点一、计算机网络概述二、网络分类三、网络性能指标四、网络协议与体系结构五、数据交换方式六、物理层与数据链路层七、网络层与运输层八、应用…...
Java中的getInterfaces()方法:使用与原理详解
在Java中,反射(Reflection)是一个强大的工具,它允许程序在运行时动态地获取类的信息并操作类的属性和方法。getInterfaces()方法是Java反射API中的一个重要方法,用于获取类或接口直接实现的接口。本文将深入探讨getInt…...
MySQL为什么默认引擎是InnoDB ?
大家好,我是锋哥。今天分享关于【MySQL为什么默认引擎是InnoDB ?】面试题。希望对大家有帮助; MySQL为什么默认引擎是InnoDB ? 1000道 互联网大厂Java工程师 精选面试题-Java资源分享网 MySQL 默认引擎是 InnoDB,主要…...
玄武计划--干中学,知行合一
作为开发者转型安全领域有一定优势,但需要系统学习网络安全知识。以下是针对你的情况(Java背景 + 快速入门)的实战导向学习路径,分为基础、工具、漏洞利用和进阶四个阶段: 一、基础准备(1-2周) 网络协议与渗透基础 重点协议:深入理解 TCP/IP、HTTP/HTTPS、DNS、SMTP,用…...
【AIGC专栏】AI在自然语言中的应用场景
ChatGPT出来以后,突然间整个世界都非常的为之一惊。很多人大喊AI即将读懂人类,虽然这是一句夸大其词的话,但是经过未来几十年的迭代,ChatGPT会变成什么样我们还真的很难说。在当前生成式内容来说,ChatGPT毫无疑问在当前…...
3D gaussian splatting 源码剖析与demo验证
0.概述 本文对最原始的3D GS源码进行剖析,逐段分析其中的主要代码模块,结合其原理加深理解,同时结合demo演示给出具体的验证。 1.流程图 2.源码剖析 3.验证与实现...
【cocos官方案例改】跳跃牢猫
自制游戏【跳跃牢烟】 案例解析 案例需求,点击鼠标控制白块左右。 资源管理器部分 在body创建一个2d精灵用作玩家。 在地下在创建一个2d精灵用来代表地面。 在body下挂在脚本。 全部脚本如下 (在二次进行复刻时候,发现把代码复制上去无法…...
docker安装nacos2.2.4详解(含:nacos容器启动参数、环境变量、常见问题整理)
一、镜像下载 1、在线下载 在一台能连外网的linux上执行docker镜像拉取命令 docker pull nacos:2.2.4 2、离线包下载 两种方式: 方式一: -)在一台能连外网的linux上安装docker执行第一步的命令下载镜像 -)导出 # 导出镜像到…...
使用 postman 测试思源笔记接口
思源笔记 API 权鉴 官方文档-中文:https://github.com/siyuan-note/siyuan/blob/master/API_zh_CN.md 权鉴相关介绍截图: 对应的xxx,在软件中查看 如上图:在每次发送 API 请求时,需要在 Header 中添加 以下键值对&a…...
RK3568使用QT操作LED灯
文章目录 一、QT中操作硬件设备思路Linux 中的设备文件操作硬件设备的思路1. 打开设备文件2. 写入数据到设备3. 从设备读取数据4. 设备控制5. 异常处理在 Qt 中操作设备的典型步骤实际应用中的例子:控制 LED总结二、QT实战操作LED灯设备1. `mainwindow.h` 头文件2. `mainwindo…...
51单片机开发——I2C通信接口
I2C是微电子通信控制领域广泛采用的一种总线标准。 起始和停止信号: void iic_start(void) {IIC_SDA1;//如果把该条语句放在SCL后面,第二次读写会出现问题delay_10us(1);IIC_SCL1;delay_10us(1);IIC_SDA0; //当SCL为高电平时,SDA由高变为低d…...
GitHub Actions定时任务配置完全指南:从Cron语法到实战示例
你好,我是悦创。 博客网站:https://blog.bornforthis.cn/ 本教程将详细讲解如何在GitHub Actions中配置定时任务(Scheduled Tasks),帮助你掌握 Cron 表达式的编写规则和实际应用场景。 一、定时任务基础配置 1.1 核…...
【网络】3.HTTP(讲解HTTP协议和写HTTP服务)
目录 1 认识URL1.1 URI的格式 2 HTTP协议2.1 请求报文2.2 响应报文 3 模拟HTTP3.1 Socket.hpp3.2 HttpServer.hpp3.2.1 start()3.2.2 ThreadRun()3.2.3 HandlerHttp() 总结 1 认识URL 什么是URI? URI 是 Uniform Resource Identifier的缩写&…...
在K8s中部署动态nfs存储provisioner
背景 之前,我已经在一台worker node上安装了local lvm 的provisioner来模拟需要本地高IOPS的数据库等stafeful应用的实现。 为了后续给虚拟机里的K8s集群安装可用的metrics和logs监控系统(metrics和logs的时序数据库需要永久存储)࿰…...
优雅管理Python2 and python3
python2 和 python3, 由于没有像其他软件的向下兼容,必须同时安装Python2 和Python3 ,介绍在linux和windows下优雅管理。 一、linux中安装Python2和Python3 linux 中用conda 创建虚拟环境,来管理不同版版工具 由于主流使用Python3…...
