Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
|
openvino [2026/03/13 15:28] jango |
openvino [2026/03/13 23:41] (aktuell) jango |
||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | OpenVINO (Open Visual Inference and Neural Network Optimization) ist ein Toolkit von Intel zur Ausführung und Optimierung von KI-Modellen auf unterschiedlicher Hardware. Es richtet sich vor allem an Anwendungen im Bereich Computer Vision, unterstützt aber auch weitere Modelltypen wie Sprach- und Generative-AI Workloads. Dazu bietet das Toolkit Funktionen zur Modellkonvertierung, | ||
| + | |||
| + | =====Diffusers===== | ||
| + | |||
| + | Image generation mit [[StableDiffusion]] in [[coding: | ||
| + | |||
| < | < | ||
| python -m venv openvino_env | python -m venv openvino_env | ||
| .\openvino_env\bin\activate | .\openvino_env\bin\activate | ||
| python -m pip install --upgrade pip | python -m pip install --upgrade pip | ||
| - | pip install " | + | pip install " |
| </ | </ | ||
| + | ====Text to Image==== | ||
| <code python> | <code python> | ||
| # sd15_openvino.py | # sd15_openvino.py | ||
| Zeile 39: | Zeile 46: | ||
| print(f" | print(f" | ||
| </ | </ | ||
| + | |||
| + | ====Image to Image==== | ||
| + | |||
| + | <code python> | ||
| + | from optimum.intel import OVStableDiffusionImg2ImgPipeline | ||
| + | from PIL import Image | ||
| + | import time | ||
| + | |||
| + | model_id = " | ||
| + | device = " | ||
| + | |||
| + | prompt = "a cozy cabin in the woods at sunset, detailed, cinematic lighting" | ||
| + | |||
| + | # Eingabebild laden | ||
| + | init_image = Image.open(" | ||
| + | |||
| + | start = time.time() | ||
| + | |||
| + | pipe = OVStableDiffusionImg2ImgPipeline.from_pretrained( | ||
| + | model_id, | ||
| + | export=True, | ||
| + | device=device | ||
| + | ) | ||
| + | |||
| + | result = pipe( | ||
| + | prompt=prompt, | ||
| + | image=init_image, | ||
| + | strength=0.6, | ||
| + | guidance_scale=7.5, | ||
| + | num_inference_steps=20 | ||
| + | ).images[0] | ||
| + | |||
| + | result.save(" | ||
| + | |||
| + | print(f" | ||
| + | </ | ||
| + | |||
| + | =====Links===== | ||
| + | |||
| + | * [[https:// | ||