Skip to content

Commit a653c6a

Browse files
committed
Change the default to Depth Anything V2 Base
1 parent 7404442 commit a653c6a

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Changelog
22
### 0.4.8
3-
* Depth Anything V2 support Thanks [@graemeniedermayer](https://github.com/graemeniedermayer)!
3+
* Depth Anything V2 support, thanks [@graemeniedermayer](https://github.com/graemeniedermayer)!
44
### 0.4.7
55
* Tiling mode
66
* Reduced VRAM consumption for Depth Anything, as well as for ZoeDepth k and nk

src/common_constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def __init__(self, default_value=None, *args):
1616
self.df = default_value
1717

1818
COMPUTE_DEVICE = "GPU"
19-
MODEL_TYPE = "res101" # Will become enum element
20-
BOOST = True
19+
MODEL_TYPE = "Depth Anything v2 Base" # Will become enum element
20+
BOOST = False
2121
NET_SIZE_MATCH = False
2222
NET_WIDTH = 448
2323
NET_HEIGHT = 448

src/common_ui.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,16 @@ def main_ui_panel(is_depth_tab):
4040
'zoedepth_n (indoor)', 'zoedepth_k (outdoor)', 'zoedepth_nk',
4141
'Marigold v1', 'Depth Anything', 'Depth Anything v2 Small',
4242
'Depth Anything v2 Base', 'Depth Anything v2 Large'],
43-
type="index")
43+
value='Depth Anything v2 Base', type="index")
4444
with gr.Box() as cur_option_root:
4545
inp -= 'depthmap_gen_row_1', cur_option_root
4646
with gr.Row():
4747
inp += go.BOOST, gr.Checkbox(label="BOOST",
48-
info="Generate depth map parts in a mosaic fashion - very slow")
49-
inp += go.NET_SIZE_MATCH, gr.Checkbox(label="Match net size to input size", visible=False,
48+
info="Generate depth map parts in a mosaic fashion - very slow",
49+
value=False)
50+
inp += go.NET_SIZE_MATCH, gr.Checkbox(label="Match net size to input size",
5051
info="Net size affects quality, performance and VRAM usage")
51-
with gr.Row(visible=False) as options_depend_on_match_size:
52+
with gr.Row() as options_depend_on_match_size:
5253
inp += go.NET_WIDTH, gr.Slider(minimum=64, maximum=2048, step=64, label='Net width')
5354
inp += go.NET_HEIGHT, gr.Slider(minimum=64, maximum=2048, step=64, label='Net height')
5455
with gr.Row():

src/depthmap_generation.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,24 @@ def flatten(el):
302302

303303
@staticmethod
304304
def get_default_net_size(model_type):
305+
# Have you ever wondered why so many things in so many code repositories are not optimal?
306+
# For example, this here is a set of int:tuple. Why wouldn't it be a set of enum:tuple?
307+
# Or even better, why won't every model be defined separately with all it's necessary values and constants in one place? And why one like of this comment is much longer than the other ones?!
308+
# Why won't the models indexed by enum elements, not integers?
309+
# The answer is as definite as it is horrifying: tech depth.
310+
# This here is a prime example of how tech debt piles up: one slightly iffy decision a long time ago,
311+
# then nothing is done with it for quite some time, stuff starts depending on it, more stuff is added.
312+
# The old code are like blocks are like jenga blocks that are experiencing ever-increasing pressure,
313+
# in tower that (just as code) grows to infinity. And noone wants to knock out the jenga.
314+
# Noone wants to spend hours of their life fixing it - because adding new features is more exciting.
315+
# Once merely a suboptimal thing, that worked perfectly at a time, turns into this monster that slowly
316+
# takes your sanity away. It's not that it ambushes you directly - like a hungry moskquito it knows that
317+
# being too annoying will warrant immediate action and smashing. Instead, it bothers you just a
318+
# couple of sound decibels and droplets of blood less than necessary for you to actually go and deal with it.
319+
# And mind you, this is one buffed maskito: well, actually it got beefed up with time.
320+
# Now it is just a giant mockyto monster. Noone wants to fight it because it is scary,
321+
# and thus this threshold of pain is much higher. Don't repeat our mistakes: fight the giant mojito monsters and
322+
# don't let them spread!
305323
sizes = {
306324
0: [448, 448],
307325
1: [512, 512],

0 commit comments

Comments
 (0)