(from Bing Copilot)
Diffusion‑based super‑resolution (SR) models often struggle to balance:
- pixel‑level fidelity (structure, geometry)
- semantic detail (perceptual sharpness)
- texture realism (material appearance, micro‑patterns)
(from Bing Copilot)
Diffusion‑based super‑resolution (SR) models often struggle to balance:
| from dash import Dash, Patch, dcc, html, Input, Output, callback | |
| import plotly.express as px | |
| import numpy as np | |
| import torch | |
| import torchvision | |
| app = Dash(__name__) | |
| def load_image(image_path): |
| from nicegui import events, ui | |
| def mouse_handler(e: events.MouseEventArguments): | |
| color = "SkyBlue" if e.type == "mousedown" else "SteelBlue" | |
| ii.content += f'<circle cx="{e.image_x}" cy="{e.image_y}" r="15" fill="none" stroke="{color}" stroke-width="4" />' | |
| ui.notify(f"{e.type} at ({e.image_x:.1f}, {e.image_y:.1f})") | |
| src = "https://picsum.photos/id/565/640/360" |
| import numpy as np | |
| from pathlib import Path | |
| names = [ | |
| str(p).replace("/", "-").replace("\\", "-").replace("C:-", "").lower().strip("-") | |
| for p in Path("/mnt/c/Windows").glob("*/*") | |
| if len(str(p)) < 40 | |
| ] |
| # setup FIFO and hang python interpreter | |
| fifo_path=$TMPDIR/"pysh-"$(date +%s) | |
| mkfifo $fifo_path | |
| python3 <$fifo_path & | |
| exec 3>$fifo_path | |
| # perform some commands | |
| echo 'import os' >$fifo_path | |
| cat >$fifo_path <<EOF | |
| import json |
The idea is to use this along with -v $PWD:/app option.
Whenever you use this workflow all files created in your
working directory will be created by the docker user (e.g. root)
requiring you to use sudo for clean-up...
... random sudo rm -rf something is just what you need in your life.