Carte de profondeur pour des planches qui suivent les volumes
La profondeur de la scène est estimée à partir de la photo (MiDaS small ou Depth Anything V2 Small) et mélangée aux gris : les planches suivent les volumes du sujet plutôt que ses lumières et ses ombres. - Onglet « Profondeur » : part de la carte de profondeur, modèle, et détails fins de la photo gravés dans la profondeur (yeux, bouche). - Répartition des niveaux : rapproche les planches d'aires égales quand les valeurs sont tassées sur quelques gris. - Images 16 bits lues sur toute leur plage (elles étaient écrêtées à 255). - Le Python d'Inkscape (MinGW, sans pip) ne peut pas charger onnxruntime : le calcul tourne dans un environnement à part, installé par deploy.ps1 -Depth, lancé en sous-processus, résultat gardé en cache. - Depth Anything sur la carte graphique (DirectML) avec repli sur le processeur ; MiDaS small toujours sur le processeur, DirectML lui faisant rendre une carte fausse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AumyrbcuQobB3GbPrFjG9i
This commit is contained in:
1 parent
16589716fd
commit
3ed0fa0987
13 files changed
+1090
-37
No files matched your search
@@ -13,6 +13,9 @@
|
||||
<page name="levels" gui-text="Levels">
|
||||
<param name="levels" type="int" min="2" max="64"
|
||||
gui-text="Number of gray levels:">16</param>
|
||||
<param name="equalize" type="float" precision="0" min="0" max="100"
|
||||
gui-text="Level distribution (% of equal areas):"
|
||||
gui-description="0 keeps evenly spaced thresholds. 100 spreads the levels so that every board covers the same area: use it when most of the image sits in a few grays, as in a depth map.">0</param>
|
||||
<param name="shapes" type="optiongroup" appearance="combo"
|
||||
gui-text="Content of each board:">
|
||||
<option value="light">Stacked, lightest in front (board no. 1 = darkest, whole image)</option>
|
||||
@@ -40,6 +43,22 @@
|
||||
gui-text="Smooth the outlines with Bézier curves">true</param>
|
||||
</page>
|
||||
|
||||
<page name="depth" gui-text="Depth">
|
||||
<param name="depth_mix" type="float" precision="0" min="0" max="100"
|
||||
gui-text="Depth map share (%):"
|
||||
gui-description="0 uses the grays of the image alone, 100 its estimated depth alone. In between, the depth gives the volumes and the grays keep details such as the eyes and the mouth. Needs the depth models, installed by deploy.ps1 -Depth.">0</param>
|
||||
<param name="depth_model" type="optiongroup" appearance="combo"
|
||||
gui-text="Depth model:">
|
||||
<option value="midas_small">Fast (MiDaS small)</option>
|
||||
<option value="depth_anything_v2_small">Fine (Depth Anything V2 Small)</option>
|
||||
</param>
|
||||
<param name="depth_detail" type="float" precision="0" min="0" max="200"
|
||||
gui-text="Fine details of the photo (%):"
|
||||
gui-description="Carves the fine contrasts of the photo (eyes, mouth, eyebrows, strands of hair) into the depth, which has none of them. A plain background brings nothing and stays at the back. 0 keeps the smooth depth alone.">100</param>
|
||||
<label>The depth of the scene is estimated from the photo: near areas become light, far areas dark. With boards stacked lightest in front, the nearest part of the subject ends up in front.</label>
|
||||
<label>The estimate runs on the graphics card when possible and is kept in a cache: only the first run on an image takes a few seconds.</label>
|
||||
</page>
|
||||
|
||||
<page name="style" gui-text="Style">
|
||||
<param name="fill_mode" type="optiongroup" appearance="combo" gui-text="Fill:">
|
||||
<option value="gray">Gray of each level</option>
|
||||
@@ -80,6 +99,8 @@ The image is smoothed, then split into the requested number of gray levels with
|
||||
|
||||
Each gray level goes into its own layer, named Board no. 1, Board no. 2... from the back to the front, added above the image: as many new layers as gray levels. The boards are meant to be cut and stacked: board no. 1 covers the whole image and each following board is smaller and lies in front of the previous one, lightest (or darkest) in front. In each layer, the cut outline of the board is drawn in the cut color (red), and the outline of the next board is carried over in the marking color (black), to show where to glue it. With "Its own gray only", a board holds the flat area of its gray alone: the boards sit side by side without overlapping and carry no marking. Several selected images share the same layers.
|
||||
|
||||
For a relief that follows the real volumes of a portrait rather than its light and shadows, raise the depth map share (Depth tab): at 100, the boards follow the volumes, and the fine details setting carves the eyes and the mouth into them. A depth map made elsewhere (8 or 16 bits) can also be imported and selected like any image, with a share of 0. In both cases, if most boards come out empty or the subject only gets a few of them, raise the level distribution.
|
||||
|
||||
For laser cutting, choose no fill: only the cut and marking strokes remain. For line art only, choose a white single-color fill, or no fill, with a black stroke and no marking. If the outlines are too busy, raise the smoothing or the smallest island; if they look angular, raise the smoothing or the simplification. If a face is no longer recognizable, lower the smoothing and keep "Preserve edges" checked.</label>
|
||||
</page>
|
||||
</param>
|
||||
|
||||
Reference in new issue
Block a user