Rake Task failing in 'docker-compose up'

Expected Behavior

docker-compose up should generate web/db container within docker successfully
Current Behavior

docker-compose up currently fails on Step 15 in Dockerfile: Step 15 : RUN DB_ADAPTER=nulldb bundle exec rake assets:precompile
Possible Solution

Given the trace below, it would appear it is looking for a library that does not exist, or is a gem that is not installed during the bundle process.
First, the output during the bundle step
Step 14 : RUN bundle install --without development test
 ---> Running in e0b9d95942fb
Fetching gem metadata from https://rails-assets.org/...
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from https://rails-assets.org/..
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rails-assets.org/..
Fetching dependency metadata from https://rubygems.org/..
Fetching git://github.com/projectjellyfish/jellyfish-demo.git
Fetching gem metadata from https://rails-assets.org/...
Fetching version metadata from https://rails-assets.org/..

Gems in the groups development and test were not installed.
Bundled gems are installed into /usr/local/bundle.
Post-install message from acts-as-taggable-on:
When upgrading

Re-run the migrations generator

    rake acts_as_taggable_on_engine:install:migrations

This will create any new migrations and skip existing ones
Version 3.5.0 has a migration for mysql adapter

And then the failing step mentioned above
Step 15 : RUN DB_ADAPTER=nulldb bundle exec rake assets:precompile
 ---> Running in 2de57bdcbafc
rake aborted!
Sprockets::FileNotFound: couldn't find file 'angular-color-picker/angularjs-color-picker' with type 'application/javascript'
/api/app/assets/javascripts/libraries.js:24
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/resolve.rb:64:in `resolve!'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/directive_processor.rb:399:in `resolve'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/directive_processor.rb:207:in `process_require_directive'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/directive_processor.rb:180:in `block in process_directives'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/directive_processor.rb:178:in `each'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/directive_processor.rb:178:in `process_directives'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/directive_processor.rb:83:in `_call'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/directive_processor.rb:68:in `call'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/loader.rb:60:in `block in load'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/loader.rb:44:in `load'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/cached_environment.rb:47:in `load'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/bundle.rb:23:in `block in call'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/utils.rb:183:in `dfs'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/bundle.rb:24:in `call'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/loader.rb:60:in `block in load'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/loader.rb:44:in `load'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/cached_environment.rb:47:in `load'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/base.rb:66:in `find_asset'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/manifest.rb:134:in `block in find'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/manifest.rb:133:in `each'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/manifest.rb:133:in `find'
/usr/local/bundle/gems/sprockets-3.6.0/lib/sprockets/manifest.rb:185:in `compile'
/usr/local/bundle/gems/sprockets-rails-3.0.4/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
/usr/local/bundle/gems/sprockets-3.6.0/lib/rake/sprocketstask.rb:147:in `with_logger'
/usr/local/bundle/gems/sprockets-rails-3.0.4/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
ERROR: Service 'web' failed to build: The command '/bin/sh -c DB_ADAPTER=nulldb bundle exec rake assets:precompile' returned a non-zero code: 1

Steps to Reproduce (for bugs)

Clone Jellyfish repository
Run docker-compose up from docker terminal inside project directory

Context

Currently unable to create a Docker container with Project Jellyfish due to this issue.
Your Environment

Version used: Latest on origin/develop
Browser Name and version: N/A
Operating System and version (desktop or mobile): Max OSX

Looks like the library name changed from 'rails-assets-angularjs-color-picker' to 'rails-assets-angular-color-picker'.  I've updated the code.

Hmm...looks like that lib went through all sorts of changes...


Service type: edit modal

Is your feature request related to a problem? Please describe.
User wants to edit the saved Service type
Acceptance Criteria
GIVEN I am a logged in **ADMIN** user
AND I navigate to Organization settings > Components tab

WHEN I click on the Edit button for a Service type

THEN I see a modal window to edit:
- Service type (required)
- Description (optional)

Additional context

Hi @ninetteadhikari can I work on this issue?


Permission denied when used with Vagrant

When using this role through the Vagrant Ansible provisioner the local_action which writes data in to /usr/local/src/ansible fails with the following permissions error:
TASK: [groover.tomcat | Install local ansible data path directory (local)] ****
<<IP_ADDRESS>> REMOTE_MODULE file state=directory owner=0 group=0 mode=2777 dest=/usr/local/src/ansible/data
failed: [tc1 -> <IP_ADDRESS>] => {"failed": true, "parsed": false}
invalid output was: Traceback (most recent call last):
  File "/home/egrant/.ansible/tmp/ansible-tmp-1416997610.02-204869902985063/file", line 1675, in <module>
    main()
  File "/home/egrant/.ansible/tmp/ansible-tmp-1416997610.02-204869902985063/file", line 216, in main
    os.mkdir(curpath)
OSError: [Errno 13] Permission denied: '//usr/local/src/ansible'

FATAL: all hosts have already failed -- aborting

I think this might be a similar issue to https://github.com/silpion/ansible-packerio/issues/1 but I can't quite figure out a good approach. I initially tried running the role with sudo: true and configuring ansible.ask_sudo_pass = true in my VagrantFile, however this didn't make any difference. I subsequently realised that the local_action task doesn't use sudo anyway so am guessing this is why this doesn't work?.
I may be missing something obvious in my setup, would you be able to elaborate on the intended way of running this?
Many thanks,
Edd

Hi, finaly had the chance to fix that.


(MCO-591) Fix condrestart on debian for AIO agent

condrestart was built around some sort of busted lock file
functionality. This changes it to rely on start-stop-daemon to
determine if the process is running or not.

CLA signed by all contributors.

:+1:


[MM-20432] Migrate components/channel_view module and associated tests to TypeScript

Summary
Migrate components/channel_view module and associated tests to TypeScript
I'm kind of new to TypeScript so I was not sure about the proper way to convert the code. Let me know if I need to change anything!
Ticket Link
Github Issue: Fixes https://github.com/mattermost/mattermost-server/issues/16142
JIRA ticket: Fixes https://mattermost.atlassian.net/browse/MM-20432

Hello @kcc343,
Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

@ethervoid I did your requested changes but have a comment above for one of them for a problem I had (if it is a problem). Let me know if I need to make any more changes!

/update-branch

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!
/cc @jasonblais @jfrerich @emilyacook

@catalintomai friendly reminder to help with review :)

/update-branch

/update-branch

@ethervoid I didn't close https://mattermost.atlassian.net/browse/MM-20432 as QA test steps are missing. Could you please take care of that?

@hanzei done!

Thanks @ethervoid :+1:


SSH command completion

Sultan is not able to detect SSH command completion. However if you Ctrl+C the first instance of the command and re-run it a second time, things work well.
Here is a code sample of what I am using:
with Sultan.load(hostname='<IP_ADDRESS>', user='ubuntu', log=True) as sultan:
            sultan.sudo("apt-get update").run()

This is repeatable through pretty much all commands.

I will take a look into this and follow up with you.


Slidy run "ERROR: Please, add param 'scripts' in your pubspec.yaml"

Hey guys, since I upgraded slidy to version 3.0.0 I haven't been able to use the command "slidy run

Hi, Marcus !
I had this problem too.
I had the spacing in relation to the left in the wrong way.
I fixed it and it is now working perfectly.

Me too. And I can't create a page with slidy g p modules/page/page

@edukmattos I have tripled checked but it doesn't seem to be any indentations.
I have tried to run it in other projects that used to work and didn't have any modifications over the last months but still happening with the same issue.

@JacquesMarques @marcuslindemannrohden I'm using a project with Flutter 2.0 and Slidy 3.0 and it's working ok

@JacquesMarques @marcuslindemannrohden I'm using a project with Flutter 2.0 and Slidy 3.0 and it's working ok

Hey @edukmattos, can you please double-check wich dart versions you are using?
It could be a problem caused by the last as I upgraded flutter and dart on the same day.

Fixed!


Wetty slowdown

With the new typescipt-webpack config, my wetty instance running a midnight commander is reacting really slow.
The terminal opens mc fine, no error messages, but then navigating between files and folders is significantly slower than on previous versions of wetty.
Unfortunately, I have no tools or know-how for debugging this issue, but if there is anything I can do, please let me know ...
... this seems to be the show-stopper for now :(

I'm running the latest version of WeTTY and it's often VERY slow for me. I'm connected via LAN, and for example, a simple 'smartctl -h' command takes 5+ seconds to display the output.
There are times when WeTTy is more responsive, but most of the time it's slow.
This is running in Docker via OMV, on an HP server, with 3% CPU and 6% RAM usage.


Cannot open multiple remote terminals in Editor

When I open terminals, I've set them to open them in the Editor instead of in the view.
I'd expect if I open a new terminal, it'd open a new terminal process so I have 2 different terminals.
Instead, both terminals will reflect each others state. Even weirder, the new terminal will override the old one; once I close the new terminal, the old terminals state will come back
I am using the Remote - SSH and a Workspace. But I cannot appear to reproduce this behavior in a fresh non-remote editor so I assume something's up with the vscode-remote extension. I also don't appear to see this behavior when using multiple terminals with the View Tab functionality.
Is this behavior expected?

Likely fixed in insiders

@meganrogge is that just VSCode Insiders? I can give that a try tomorrow if so.

yes @sidewinder12s it should be fixed in the Insiders build?

It appears this is fixed in the latest release:
Version: 1.64.0
Commit: 5554b12acf27056905806867f251c859323ff7e9
Date: 2022-02-03T04:23:11.224Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.4.0-97-generic

Thanks!


Translate from EN to PT guide > Security overview

Translate from EN to PT guide > Security overview

Gastaldi, there is no link after the pull request approved. I checked my e-mail, but I didn't receive anything from Quarkus with a preview link from the translation. Do you know about it?

We're facing some issues with Surge.sh (the preview site) so we're skipping in the meantime, thanks for pointing that out.

Oh! Ok, I got it.
Thanks for your information!


Importing validator accounts to nimbus doesn't work

Reported on our Discord:
I have issues with importing validator keys. Nimbus/mainnet/Ubuntu 20.04.
GUI show everything is ok, except after successful import the validator list is empty.
I've put validator keys into /opt/stereum/ethereum2-docker-compose/launchpad/ and I've tried to execute playbook manually:
# ansible-playbook import-validator-accounts.yaml -e validator_keys_path=/opt/stereum/ethereum2-docker-compose/launchpad/ -e validator_password=INCORRECT_PASSWORD

No matter if password is correct or not, playbook finishes succesfully. Do you have any advice?
Oh, I can see the output from import script:
"stdout_lines": [
            "spawn sh -c  sudo docker exec -it stereum_beacon_1 /opt/app/build/nimbus_beacon_node deposits import \"/opt/app/validator_keys\" --data-dir=\"/opt/app/validator\" --network=\"mainnet\" ",
            "Error while processing the \u001b[34mimportedDepositsDir=/opt/app/validator_keys\u001b[0m parameter: Directory doesn't exist\u001b[0m",
            "Try \u001b[36mnimbus_beacon_node --help\u001b[0m for more information."
        ]

So there is no /opt/app/validator_keys directory inside docker container. When this directory should be created and by which script/playbook?
I copied validator keys into docker container, to /tmp directory. Then I run:
docker exec -it stereum_beacon_1 /opt/app/build/nimbus_beacon_node deposits import /tmp --data-dir=/opt/app/validator --network=mainnet

This time I was asked for password and typing incorrect one generated password invalid message.
After typing correct password everything went fine. I've restarted docker container and I still can't see any validator activity 😦
NOT 2022-05-25 20:11:31.815+00:00 Starting beacon node topics="beacnde" version=v22.3.0-13b264-stateofus ... SLOTS_PER_EPOCH=32 SECONDS_PER_SLOT=12 SPEC_VERSION=1.1.10 dataDir=/opt/app/beacon validators=0

I'll have a look


how put text in page

I want to write text in every page. please guide how I put to each page the text ?

or How to connect it to the database. Because I want to write a novel

@mahdimzf2015 You need to call android graphic lib to draw text on a bitmap and then pass the bitmap to PageFlip for showing. You can find a little bit codes in our sample application, hope it could give you an initial thought


refactor: replace simple-oauth2 by openid-client

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

Hi @zhongjixiuxing , can you join the QQ group: 645200447 ?


update to rustc 1.0.0-nightly (706be5ba1 2015-02-05 23:14:28 +0000)

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @huonw (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
Please see CONTRIBUTING.md for more information.

Thanks!


true metric depth values

Hi @LiheYoung ,
This is super impressive work. I used the huggingface deployment to test out the network. I gave it a sample image from a camera with known camera intrinsics and it output a depth map(consider it as disparity as it says on huggingface). I see per pixel values of the depth/disparity map but I do not know how to go about extracting per pixel true metric depth from these. Are the depth maps relative or are they true metric? If they are true metric, then how can I go about extracting per pixel metric depth?

Hi @LiheYoung, I also have the same query, how do i get metric depth information from the disparity maps? The information under metric_depth is only evaluation results and not the true depth values. I would really appreciate if you could share your insights on this.
BTW you guys did a really amazing job here.

I believe using the "pred" model output from the evaluate.py script  https://github.com/LiheYoung/Depth-Anything/blob/5935968f82018d68fff44946573d34cdf27db827/metric_depth/evaluate.py#L80 (assuming you assign the correct focal length in the line above the model output) and using this https://github.com/LiheYoung/Depth-Anything/blob/main/metric_depth/zoedepth/utils/geometry.py should be all you need.
Since based on the ZoeDepth training pipeline the model output is metric depth in units of meters.

Hi @abhishekmonogram and @Abubakar17, the demo on the huggingface only outputs the relative depth (disparity), rather than the metric depth. As @loevlie mentioned, if you hope to obtain metric depth values, please refer to: https://github.com/LiheYoung/Depth-Anything/tree/main/metric_depth. Also, you may refer to the files @loevlie mentioned.

Hi @LiheYoung when you say its disparity, why are the outputs as depth tensor format and would you know the correct transformation to 3D point clouds even in the arbitrary scale?
Also could you upload a file to infer simply on new inputs and get a coloured point cloud? This would be very very helpful.

Thank you @loevlie for providing with those resources. The evaluate function is still to evaluate only on a custom dataset like NYU right. Do you know if there is script that directly does inference on any custom image?
@LiheYoung If huggingface outputs only disparity, how do I get the depth map from it? Because to get the depth, you also need the baseline, which is missing in case of monocular cameras.
Also could you comment on the accuracy of the per pixel true metric depth when you fine tuned on your own dataset. I read through the table in the paper, but it found it a little bit confusing to interpret those metrics.

Hey @abhishekmonogram, I got the evaluate function to work on my own dataset by mainly following this article.  I might write a script to run inference on a custom image, if I do I will share it.

Pretty good on visualisation. Is it possible to confirm that the depths say 4.54 is in metres and there are no additional scales at play?

I believe it would be extremely helpful to have a function that accepts an image path and a focal length (with the current default value) as inputs, and then generates a depth map with metric values. It can be quite challenging for someone who isn't deeply involved in this specific field to create such a method.

I will update with my code right here, just waiting for the confirmation of
the author on the correctness of scale.
On Fri, 26 Jan, 2024, 11:25 pm shizurumaya, @.***>
wrote:

I believe it would be extremely helpful to have a function that accepts an
image path and a focal length (with the current default value) as inputs,
and then generates a depth map with metric values. It can be quite
challenging for someone who isn't deeply involved in this specific field to
create such a method.
—
Reply to this email directly, view it on GitHub
https://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-1912458399,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJWHFEE4BVGHIQYH6P3GYC3YQPUZNAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSGQ2TQMZZHE
.
You are receiving this because you commented.Message ID:
@.***>

Hi @1ssb , our Depth Anything models primarily focus on relative depth estimation. Thus, the output value from the HuggingFace published models does not represent any metric meanings. However, if you want to obtain metric depth information (in meters), you can use our models introduced here: https://github.com/LiheYoung/Depth-Anything/tree/main/metric_depth, just like @loevlie mentioned.

Hi @LiheYoung I am indeed using the metric depth and the point cloud I have
uploaded is indeed from the zoedepth. Can you kindly confirm that if these
values of depth are for example 4.35 metres etc, they are indeed in metres
wothout any need for further analysis/transformation?
On Sat, 27 Jan, 2024, 10:15 am Lihe Yang, @.***> wrote:

Hi @1ssb https://github.com/1ssb , our Depth Anything models primarily
focus on relative depth estimation. Thus, the output value from the
HuggingFace published models does not represent any metric meanings.
However, if you want to obtain metric depth information (in meters),
you can use our models introduced here:
https://github.com/LiheYoung/Depth-Anything/tree/main/metric_depth, just
like @loevlie https://github.com/loevlie mentioned.
—
Reply to this email directly, view it on GitHub
https://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-1912987120,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJWHFEDBCBTCPDR2TMZLWYDYQSA7ZAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSHE4DOMJSGA
.
You are receiving this because you were mentioned.Message ID:
@.***>

Yes, they are indeed in meters.

Ok here is my code, let me no if you find any glitches, @LiheYoung you can integrate this file asa commit with changes if you would like so.
# infer.py
# Code by @1ssb
# Code gets metric depth from single images using Depth Anything --- Zoedepth style.

import argparse
from tqdm import tqdm
import os, glob, torch
from PIL import Image
import torchvision.transforms as transforms
import numpy as np
import open3d as o3d
from zoedepth.models.builder import build_model
from zoedepth.utils.config import get_config

# Setting focal length here
FL = 715.0873 # Not using this if NYU_DATA is False
FY = 234.72
FX = 307.2
NYU_DATA = False

def infer(model, image, dataset, focal):
    """Inference with flip augmentation"""
    # Modify this part according to the specific inference process of your model
    pred = model(image, dataset=dataset, focal=focal)
    return pred

def get_depth_from_prediction(pred):
    if isinstance(pred, torch.Tensor):
        return pred
    elif isinstance(pred, (list, tuple)):
        return pred[-1]
    elif isinstance(pred, dict):
        return pred['metric_depth'] if 'metric_depth' in pred else pred['out']
    else:
        raise NotImplementedError(f"Unknown output type {type(pred)}")

def depth_to_point_cloud(depth, focal_length, color_image):
    """ Convert a depth map and color image to a point cloud """
    height, width = depth.shape

    # Resize color image to match depth map dimensions
    color_image = color_image.resize((width, height))
    if NYU_DATA:
        focal_length_x, focal_length_y = focal_length, focal_length
    else:
        focal_length_x, focal_length_y = FX, FY
    x, y = np.meshgrid(np.arange(width), np.arange(height))

    # Normalize x and y to image coordinates
    x = (x - width / 2) / focal_length_x
    y = (y - height / 2) / focal_length_y

    # Unproject
    z = depth
    x = np.multiply(x, z)
    y = np.multiply(y, z)

    # Stack to get 3D points
    points = np.stack((x, y, z), axis=-1).reshape(-1, 3)

    # Convert color image to numpy array and normalize colors
    colors = np.array(color_image).reshape(-1, 3) / 255.0

    return points, colors

def process_image(model, image_path, output_dir, dataset, focal):
    color_image = Image.open(image_path).convert('RGB')
    image_tensor = transforms.ToTensor()(color_image).unsqueeze(0).cuda()

    pred_dict = infer(model, image_tensor, dataset, focal)
    pred = get_depth_from_prediction(pred_dict).squeeze().detach().cpu().numpy()

    # Convert depth to point cloud and map colors
    points, colors = depth_to_point_cloud(pred, focal, color_image)
    pcd = o3d.geometry.PointCloud()
    pcd.points = o3d.utility.Vector3dVector(points)
    pcd.colors = o3d.utility.Vector3dVector(colors)

    # Report min and max depth
    min_depth = np.min(pred[pred > 0])  # Ignore zeros
    max_depth = np.max(pred)
    print(f"Min Depth: {min_depth}, Max Depth: {max_depth}")

    # Save point cloud as .ply
    output_filename = os.path.join(output_dir, os.path.basename(image_path).replace(".jpg", ".ply"))
    o3d.io.write_point_cloud(output_filename, pcd)

def main(config, input_dir, output_dir, dataset, focal):
    model = build_model(config).cuda()
    model.eval()

    if not os.path.exists(output_dir):
        os.makedirs(output_dir)

    image_paths = glob.glob(os.path.join(input_dir, '*.jpg'))
    for image_path in tqdm(image_paths, desc="Processing Images"):
        process_image(model, image_path, output_dir, dataset, focal)

def test_model(model_name, pretrained_resource, input_dir, output_dir, dataset, focal):
    config = get_config(model_name, "eval", dataset)
    if pretrained_resource:
        config.pretrained_resource = pretrained_resource
    main(config, input_dir, output_dir, dataset, focal)

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument("-m", "--model", type=str, default='zoedepth', help="Name of the model to test")
    parser.add_argument("-p", "--pretrained_resource", type=str, default='local::./checkpoints/depth_anything_metric_depth_indoor.pt', help="Pretrained resource to use for fetching weights.")
    # Not actually using nyu data, just keeping it here because I am too lazy to work on modifying the dataloader
    parser.add_argument("-d", "--dataset", type=str, default='nyu', help="Dataset to evaluate on")
    parser.add_argument("-i", "--input_dir", type=str, default='./my_test/input', help="Input directory containing images")
    parser.add_argument("-o", "--output_dir", type=str, default='./my_test/output', help="Output directory for point clouds")
    args = parser.parse_args()

    test_model(args.model, args.pretrained_resource, args.input_dir, args.output_dir, args.dataset, focal=FL)

# Just adapt focal length and run infer.py

Ok here is my code, let me know if you find any glitches, @LiheYoung you can integrate this file asa commit with changes if you would like so.
# infer.py
# Code by @1ssb

import argparse
from tqdm import tqdm
import os, glob, torch
from PIL import Image
import torchvision.transforms as transforms
import numpy as np
import open3d as o3d
from zoedepth.models.builder import build_model
from zoedepth.utils.config import get_config

# Focal length settings
FL = 715.0873  # Default focal length, used if NYU_DATA is False
FY = 234.72  # Focal length in Y-axis
FX = 307.2   # Focal length in X-axis
NYU_DATA = False  # Flag to indicate if NYU data-specific settings are used

def infer(model, image, dataset):
    """
    Performs model inference on a single image.

    Args:
        model (torch.nn.Module): The depth estimation model.
        image (torch.Tensor): The input image tensor.
        dataset (str): The name of the dataset being used.

    Returns:
        torch.Tensor: Predicted depth map.
    """
    pred = model(image, dataset=dataset)
    return pred

def get_depth_from_prediction(pred):
    """
    Extracts the depth map from model prediction.

    Args:
        pred (torch.Tensor | list | tuple | dict): Model prediction.

    Returns:
        torch.Tensor: Extracted depth map.
    """
    if isinstance(pred, torch.Tensor):
        return pred
    elif isinstance(pred, (list, tuple)):
        return pred[-1]
    elif isinstance(pred, dict):
        return pred.get('metric_depth', pred.get('out'))
    else:
        raise TypeError(f"Unknown output type {type(pred)}")

def depth_to_point_cloud(depth, color_image):
    """
    Converts a depth map and a color image to a 3D point cloud.

    Args:
        depth (numpy.ndarray): The depth map.
        color_image (PIL.Image): The color image.

    Returns:
        tuple: Tuple containing points and colors for the point cloud.
    """
    height, width = depth.shape
    color_image = color_image.resize((width, height))
    focal_length_x, focal_length_y = (FL, FL) if NYU_DATA else (FX, FY)

    x, y = np.meshgrid(np.arange(width), np.arange(height))
    x = (x - width / 2) / focal_length_x
    y = (y - height / 2) / focal_length_y

    z = depth
    x = np.multiply(x, z)
    y = np.multiply(y, z)

    points = np.stack((x, y, z), axis=-1).reshape(-1, 3)
    colors = np.array(color_image).reshape(-1, 3) / 255.0

    return points, colors

def process_image(model, image_path, output_dir, dataset):
    """
    Processes a single image, performs depth estimation, and saves the resulting point cloud.

    Args:
        model (torch.nn.Module): The depth estimation model.
        image_path (str): Path to the image file.
        output_dir (str): Directory to save the point cloud.
        dataset (str): The name of the dataset being used.
    """
    color_image = Image.open(image_path).convert('RGB')
    image_tensor = transforms.ToTensor()(color_image).unsqueeze(0).to('cuda' if torch.cuda.is_available() else 'cpu')

    pred_dict = infer(model, image_tensor, dataset)
    pred = get_depth_from_prediction(pred_dict).squeeze().detach().cpu().numpy()

    points, colors = depth_to_point_cloud(pred, color_image)
    pcd = o3d.geometry.PointCloud()
    pcd.points = o3d.utility.Vector3dVector(points)
    pcd.colors = o3d.utility.Vector3dVector(colors)

    min_depth, max_depth = np.min(pred[pred > 0]), np.max(pred)
    print(f"Processed {image_path}: Min Depth: {min_depth}, Max Depth: {max_depth}")

    output_filename = os.path.join(output_dir, os.path.splitext(os.path.basename(image_path))[0] + ".ply")
    o3d.io.write_point_cloud(output_filename, pcd)

def main(config, input_dir, output_dir, dataset):
    """
    Main function to process all images in a directory.

    Args:
        config (dict): Configuration for the model.
        input_dir (str): Directory containing input images.
        output_dir (str): Directory to save point clouds.
        dataset (str): The name of the dataset being used.
    """
    model = build_model(config).to('cuda' if torch.cuda.is_available() else 'cpu')
    model.eval()

    if not os.path.exists(output_dir):
        os.makedirs(output_dir)

    image_paths = glob.glob(os.path.join(input_dir, '*.png')) + glob.glob(os.path.join(input_dir, '*.jpg'))
    if not image_paths:
        print("No images found in the input directory.")
        return

    for image_path in tqdm(image_paths, desc="Processing Images"):
        try:
            process_image(model, image_path, output_dir, dataset)
        except Exception as e:
            print(f"Error processing {image_path}: {e}")

def test_model(model_name, pretrained_resource, input_dir, output_dir, dataset):
    """
    Tests a model with given parameters.

    Args:
        model_name (str): The name of the model.
        pretrained_resource (str): Path to pretrained model weights.
        input_dir (str): Directory containing input images.
        output_dir (str): Directory to save point clouds.
        dataset (str): The name of the dataset being used.
    """
    config = get_config(model_name, "eval", dataset)
    if pretrained_resource:
        config.pretrained_resource = pretrained_resource
    main(config, input_dir, output_dir, dataset)

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description="Depth estimation and point cloud generation script.")
    parser.add_argument("-m", "--model", type=str, default='zoedepth', help="Name of the model to test")
    parser.add_argument("-p", "--pretrained_resource", type=str, default='local::./checkpoints/depth_anything_metric_depth_indoor.pt', help="Pretrained resource to use for fetching weights.")
    parser.add_argument("-d", "--dataset", type=str, default='nyu', help="Dataset to evaluate on")
    parser.add_argument("-i", "--input_dir", type=str, default='./my_test/input', help="Input directory containing images")
    parser.add_argument("-o", "--output_dir", type=str, default='./my_test/output', help="Output directory for point clouds")
    args = parser.parse_args()

    test_model(args.model, args.pretrained_resource, args.input_dir, args.output_dir, args.dataset)

Hi, thanks for the code. I found that whatever the original size of the image is, the output depth possesses the shape of (392, 518). Is there a method to obtain the depth information corresponding to the original image size? Does interpolation need to be performed here?

Yes, of course, just one more step, do a tensor resizing on the RGBD before
pushing it into the point cloud by using any standard interpolator,
bilinear generally works well. You may find better ones.
On Tue, 30 Jan, 2024, 6:36 pm Mr.Hang, @.***> wrote:

Ok here is my code, let me know if you find any glitches, @LiheYoung
https://github.com/LiheYoung you can integrate this file asa commit
with changes if you would like so.
infer.py# Code by @1ssb
import argparsefrom tqdm import tqdmimport os, glob, torchfrom PIL import Imageimport torchvision.transforms as transformsimport numpy as npimport open3d as o3dfrom zoedepth.models.builder import build_modelfrom zoedepth.utils.config import get_config
Focal length settingsFL = 715.0873  # Default focal length, used if NYU_DATA is FalseFY = 234.72  # Focal length in Y-axisFX = 307.2   # Focal length in X-axisNYU_DATA = False  # Flag to indicate if NYU data-specific settings are used
def infer(model, image, dataset):
"""    Performs model inference on a single image.        Args:        model (torch.nn.Module): The depth estimation model.        image (torch.Tensor): The input image tensor.        dataset (str): The name of the dataset being used.    Returns:        torch.Tensor: Predicted depth map.    """
pred = model(image, dataset=dataset)
return pred
def get_depth_from_prediction(pred):
"""    Extracts the depth map from model prediction.    Args:        pred (torch.Tensor | list | tuple | dict): Model prediction.    Returns:        torch.Tensor: Extracted depth map.    """
if isinstance(pred, torch.Tensor):
return pred
elif isinstance(pred, (list, tuple)):
return pred[-1]
elif isinstance(pred, dict):
return pred.get('metric_depth', pred.get('out'))
else:
raise TypeError(f"Unknown output type {type(pred)}")
def depth_to_point_cloud(depth, color_image):
"""    Converts a depth map and a color image to a 3D point cloud.    Args:        depth (numpy.ndarray): The depth map.        color_image (PIL.Image): The color image.    Returns:        tuple: Tuple containing points and colors for the point cloud.    """
height, width = depth.shape
color_image = color_image.resize((width, height))
focal_length_x, focal_length_y = (FL, FL) if NYU_DATA else (FX, FY)
x, y = np.meshgrid(np.arange(width), np.arange(height))
x = (x - width / 2) / focal_length_x
y = (y - height / 2) / focal_length_y

z = depth
x = np.multiply(x, z)
y = np.multiply(y, z)

points = np.stack((x, y, z), axis=-1).reshape(-1, 3)
colors = np.array(color_image).reshape(-1, 3) / 255.0

return points, colors

def process_image(model, image_path, output_dir, dataset):
"""    Processes a single image, performs depth estimation, and saves the resulting point cloud.    Args:        model (torch.nn.Module): The depth estimation model.        image_path (str): Path to the image file.        output_dir (str): Directory to save the point cloud.        dataset (str): The name of the dataset being used.    """
color_image = Image.open(image_path).convert('RGB')
image_tensor = transforms.ToTensor()(color_image).unsqueeze(0).to('cuda' if torch.cuda.is_available() else 'cpu')
pred_dict = infer(model, image_tensor, dataset)
pred = get_depth_from_prediction(pred_dict).squeeze().detach().cpu().numpy()

points, colors = depth_to_point_cloud(pred, color_image)
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(points)
pcd.colors = o3d.utility.Vector3dVector(colors)

min_depth, max_depth = np.min(pred[pred > 0]), np.max(pred)
print(f"Processed {image_path}: Min Depth: {min_depth}, Max Depth: {max_depth}")

output_filename = os.path.join(output_dir, os.path.splitext(os.path.basename(image_path))[0] + ".ply")
o3d.io.write_point_cloud(output_filename, pcd)

def main(config, input_dir, output_dir, dataset):
"""    Main function to process all images in a directory.    Args:        config (dict): Configuration for the model.        input_dir (str): Directory containing input images.        output_dir (str): Directory to save point clouds.        dataset (str): The name of the dataset being used.    """
model = build_model(config).to('cuda' if torch.cuda.is_available() else 'cpu')
model.eval()
if not os.path.exists(output_dir):
    os.makedirs(output_dir)

image_paths = glob.glob(os.path.join(input_dir, '*.png')) + glob.glob(os.path.join(input_dir, '*.jpg'))
if not image_paths:
    print("No images found in the input directory.")
    return

for image_path in tqdm(image_paths, desc="Processing Images"):
    try:
        process_image(model, image_path, output_dir, dataset)
    except Exception as e:
        print(f"Error processing {image_path}: {e}")

def test_model(model_name, pretrained_resource, input_dir, output_dir, dataset):
"""    Tests a model with given parameters.    Args:        model_name (str): The name of the model.        pretrained_resource (str): Path to pretrained model weights.        input_dir (str): Directory containing input images.        output_dir (str): Directory to save point clouds.        dataset (str): The name of the dataset being used.    """
config = get_config(model_name, "eval", dataset)
if pretrained_resource:
config.pretrained_resource = pretrained_resource
main(config, input_dir, output_dir, dataset)
if name == 'main':
parser = argparse.ArgumentParser(description="Depth estimation and point cloud generation script.")
parser.add_argument("-m", "--model", type=str, default='zoedepth', help="Name of the model to test")
parser.add_argument("-p", "--pretrained_resource", type=str, default='local::./checkpoints/depth_anything_metric_depth_indoor.pt', help="Pretrained resource to use for fetching weights.")
parser.add_argument("-d", "--dataset", type=str, default='nyu', help="Dataset to evaluate on")
parser.add_argument("-i", "--input_dir", type=str, default='./my_test/input', help="Input directory containing images")
parser.add_argument("-o", "--output_dir", type=str, default='./my_test/output', help="Output directory for point clouds")
args = parser.parse_args()
test_model(args.model, args.pretrained_resource, args.input_dir, args.output_dir, args.dataset)

Hi, thanks for the code. I found that whatever the original size of the
image is, the output depth possesses the shape of (392, 518). Is there a
method to obtain the depth information corresponding to the original image
size? Does interpolation need to be performed here?
—
Reply to this email directly, view it on GitHub
https://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-1916806733,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJWHFEEELHCM6SR7VGA7WILYRDV7FAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJWHAYDMNZTGM
.
You are receiving this because you were mentioned.Message ID:
@.***>

Yes, of course, just one more step, do a tensor resizing on the RGBD before pushing it into the point cloud by using any standard interpolator, bilinear generally works well. You may find better ones.
…
On Tue, 30 Jan, 2024, 6:36 pm Mr.Hang, @.> wrote: Ok here is my code, let me know if you find any glitches, @LiheYoung https://github.com/LiheYoung you can integrate this file asa commit with changes if you would like so. # infer.py# Code by @1ssb import argparsefrom tqdm import tqdmimport os, glob, torchfrom PIL import Imageimport torchvision.transforms as transformsimport numpy as npimport open3d as o3dfrom zoedepth.models.builder import build_modelfrom zoedepth.utils.config import get_config # Focal length settingsFL = 715.0873 # Default focal length, used if NYU_DATA is FalseFY = 234.72 # Focal length in Y-axisFX = 307.2 # Focal length in X-axisNYU_DATA = False # Flag to indicate if NYU data-specific settings are used def infer(model, image, dataset): """ Performs model inference on a single image. Args: model (torch.nn.Module): The depth estimation model. image (torch.Tensor): The input image tensor. dataset (str): The name of the dataset being used. Returns: torch.Tensor: Predicted depth map. """ pred = model(image, dataset=dataset) return pred def get_depth_from_prediction(pred): """ Extracts the depth map from model prediction. Args: pred (torch.Tensor | list | tuple | dict): Model prediction. Returns: torch.Tensor: Extracted depth map. """ if isinstance(pred, torch.Tensor): return pred elif isinstance(pred, (list, tuple)): return pred[-1] elif isinstance(pred, dict): return pred.get('metric_depth', pred.get('out')) else: raise TypeError(f"Unknown output type {type(pred)}") def depth_to_point_cloud(depth, color_image): """ Converts a depth map and a color image to a 3D point cloud. Args: depth (numpy.ndarray): The depth map. color_image (PIL.Image): The color image. Returns: tuple: Tuple containing points and colors for the point cloud. """ height, width = depth.shape color_image = color_image.resize((width, height)) focal_length_x, focal_length_y = (FL, FL) if NYU_DATA else (FX, FY) x, y = np.meshgrid(np.arange(width), np.arange(height)) x = (x - width / 2) / focal_length_x y = (y - height / 2) / focal_length_y z = depth x = np.multiply(x, z) y = np.multiply(y, z) points = np.stack((x, y, z), axis=-1).reshape(-1, 3) colors = np.array(color_image).reshape(-1, 3) / 255.0 return points, colors def process_image(model, image_path, output_dir, dataset): """ Processes a single image, performs depth estimation, and saves the resulting point cloud. Args: model (torch.nn.Module): The depth estimation model. image_path (str): Path to the image file. output_dir (str): Directory to save the point cloud. dataset (str): The name of the dataset being used. """ color_image = Image.open(image_path).convert('RGB') image_tensor = transforms.ToTensor()(color_image).unsqueeze(0).to('cuda' if torch.cuda.is_available() else 'cpu') pred_dict = infer(model, image_tensor, dataset) pred = get_depth_from_prediction(pred_dict).squeeze().detach().cpu().numpy() points, colors = depth_to_point_cloud(pred, color_image) pcd = o3d.geometry.PointCloud() pcd.points = o3d.utility.Vector3dVector(points) pcd.colors = o3d.utility.Vector3dVector(colors) min_depth, max_depth = np.min(pred[pred > 0]), np.max(pred) print(f"Processed {image_path}: Min Depth: {min_depth}, Max Depth: {max_depth}") output_filename = os.path.join(output_dir, os.path.splitext(os.path.basename(image_path))[0] + ".ply") o3d.io.write_point_cloud(output_filename, pcd) def main(config, input_dir, output_dir, dataset): """ Main function to process all images in a directory. Args: config (dict): Configuration for the model. input_dir (str): Directory containing input images. output_dir (str): Directory to save point clouds. dataset (str): The name of the dataset being used. """ model = build_model(config).to('cuda' if torch.cuda.is_available() else 'cpu') model.eval() if not os.path.exists(output_dir): os.makedirs(output_dir) image_paths = glob.glob(os.path.join(input_dir, '.png')) + glob.glob(os.path.join(input_dir, '.jpg')) if not image_paths: print("No images found in the input directory.") return for image_path in tqdm(image_paths, desc="Processing Images"): try: process_image(model, image_path, output_dir, dataset) except Exception as e: print(f"Error processing {image_path}: {e}") def test_model(model_name, pretrained_resource, input_dir, output_dir, dataset): """ Tests a model with given parameters. Args: model_name (str): The name of the model. pretrained_resource (str): Path to pretrained model weights. input_dir (str): Directory containing input images. output_dir (str): Directory to save point clouds. dataset (str): The name of the dataset being used. """ config = get_config(model_name, "eval", dataset) if pretrained_resource: config.pretrained_resource = pretrained_resource main(config, input_dir, output_dir, dataset) if name == 'main': parser = argparse.ArgumentParser(description="Depth estimation and point cloud generation script.") parser.add_argument("-m", "--model", type=str, default='zoedepth', help="Name of the model to test") parser.add_argument("-p", "--pretrained_resource", type=str, default='local::./checkpoints/depth_anything_metric_depth_indoor.pt', help="Pretrained resource to use for fetching weights.") parser.add_argument("-d", "--dataset", type=str, default='nyu', help="Dataset to evaluate on") parser.add_argument("-i", "--input_dir", type=str, default='./my_test/input', help="Input directory containing images") parser.add_argument("-o", "--output_dir", type=str, default='./my_test/output', help="Output directory for point clouds") args = parser.parse_args() test_model(args.model, args.pretrained_resource, args.input_dir, args.output_dir, args.dataset) Hi, thanks for the code. I found that whatever the original size of the image is, the output depth possesses the shape of (392, 518). Is there a method to obtain the depth information corresponding to the original image size? Does interpolation need to be performed here? — Reply to this email directly, view it on GitHub <#36 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJWHFEEELHCM6SR7VGA7WILYRDV7FAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJWHAYDMNZTGM . You are receiving this because you were mentioned.Message ID: @.**>

Thanks, I will have a try!

Hi @yyvhang, please check the updated code.

Thanks!

I believe using the "pred" model output from the evaluate.py script
https://github.com/LiheYoung/Depth-Anything/blob/5935968f82018d68fff44946573d34cdf27db827/metric_depth/evaluate.py#L80
(assuming you assign the correct focal length in the line above the model output) and using this https://github.com/LiheYoung/Depth-Anything/blob/main/metric_depth/zoedepth/utils/geometry.py should be all you need.
Since based on the ZoeDepth training pipeline the model output is metric depth in units of meters.

Are you sure that focal=focal is necessary or even does anything?
I just cannot see it being used in any forward method, @LiheYoung, @loevlie

Ok here is my code, let me know if you find any glitches, @LiheYoung you can integrate this file asa commit with changes if you would like so.
Edit: Revised, updated and simplified code which can handle any output size.
# infer.py
# Code by @1ssb
import argparse
import os
import glob
import torch
import numpy as np
from PIL import Image
import torchvision.transforms as transforms
import open3d as o3d
from tqdm import tqdm
from zoedepth.models.builder import build_model
from zoedepth.utils.config import get_config

# Global settings
FL = 715.0873
FY = 256 * 0.6
FX = 256 * 0.6
NYU_DATA = False
FINAL_HEIGHT = 256
FINAL_WIDTH = 256
INPUT_DIR = './my_test/input'
OUTPUT_DIR = './my_test/output'
DATASET = 'nyu' # Lets not pick a fight with the model's dataloader

def process_images(model):
    if not os.path.exists(OUTPUT_DIR):
        os.makedirs(OUTPUT_DIR)

    image_paths = glob.glob(os.path.join(INPUT_DIR, '*.png')) + glob.glob(os.path.join(INPUT_DIR, '*.jpg'))
    for image_path in tqdm(image_paths, desc="Processing Images"):
        try:
            color_image = Image.open(image_path).convert('RGB')
            original_width, original_height = color_image.size
            image_tensor = transforms.ToTensor()(color_image).unsqueeze(0).to('cuda' if torch.cuda.is_available() else 'cpu')

            pred = model(image_tensor, dataset=DATASET)
            if isinstance(pred, dict):
                pred = pred.get('metric_depth', pred.get('out'))
            elif isinstance(pred, (list, tuple)):
                pred = pred[-1]
            pred = pred.squeeze().detach().cpu().numpy()

            # Resize color image and depth to final size
            resized_color_image = color_image.resize((FINAL_WIDTH, FINAL_HEIGHT), Image.LANCZOS)
            resized_pred = Image.fromarray(pred).resize((FINAL_WIDTH, FINAL_HEIGHT), Image.NEAREST)

            focal_length_x, focal_length_y = (FX, FY) if not NYU_DATA else (FL, FL)
            x, y = np.meshgrid(np.arange(FINAL_WIDTH), np.arange(FINAL_HEIGHT))
            x = (x - FINAL_WIDTH / 2) / focal_length_x
            y = (y - FINAL_HEIGHT / 2) / focal_length_y
            z = np.array(resized_pred)
            points = np.stack((np.multiply(x, z), np.multiply(y, z), z), axis=-1).reshape(-1, 3)
            colors = np.array(resized_color_image).reshape(-1, 3) / 255.0

            pcd = o3d.geometry.PointCloud()
            pcd.points = o3d.utility.Vector3dVector(points)
            pcd.colors = o3d.utility.Vector3dVector(colors)
            o3d.io.write_point_cloud(os.path.join(OUTPUT_DIR, os.path.splitext(os.path.basename(image_path))[0] + ".ply"), pcd)
        except Exception as e:
            print(f"Error processing {image_path}: {e}")

def main(model_name, pretrained_resource):
    config = get_config(model_name, "eval", DATASET)
    config.pretrained_resource = pretrained_resource
    model = build_model(config).to('cuda' if torch.cuda.is_available() else 'cpu')
    model.eval()
    process_images(model)

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument("-m", "--model", type=str, default='zoedepth', help="Name of the model to test")
    parser.add_argument("-p", "--pretrained_resource", type=str, default='local::./checkpoints/depth_anything_metric_depth_indoor.pt', help="Pretrained resource to use for fetching weights.")

    args = parser.parse_args()
    main(args.model, args.pretrained_resource)

Also, @1ssb, in the original version of the code snippet versions you had different values for the focal lengths on the x, y axis, while it has been changed to them being equal to the final image shape times a scaling factor:

why the change and why fixing the scaling factor to 0.6 (fy = 256 * 0.6)?
how could we get the focal-adjusted metric depth map instead of the focal-adjusted point cloud?

Hi @1ssb, thank you a lot for contributing this script! Would you mind making a pull request? You can put this file in our metric_depth folder and maybe name it as depth_to_pointcloud.py? I will merge it to our main branch ASAP.

Hi @DiTo97, "why changing and why fixing the scaling factor (fy = 256 * 0.6)?" this is specific to my application do not bother yourself with it.
"how could we get the focal-adjusted metric depth map instead of the focal-adjusted point cloud?" Instead of using the point cloud, normalise the tensor map of the RGBD and multiply with 255 to get a colormap.

Hi @DiTo97, "why changing and why fixing the scaling factor (fy = 256 * 0.6)?" this is specific to my application do not bother yourself with it.
"how could we get the focal-adjusted metric depth map instead of the focal-adjusted point cloud?" Instead of using the point cloud, normalise the tensor map of the RGBD and multiply with 255 to get a colormap. Utilise the script in the inference file to do this.

good to know, @1ssb.
As for the second question, I meant if it is necessary to adjust the focal length of the generated metric depth map, or not. I see you resizing the depth map, and consequently re-scaling the map by the desired focal length, before projecting it in a point cloud. Maybe it's related to your specific use case that you were mentioning, e.g., are the specific focal length you put in the focal length from the RGB canera intrinsics?
To sum up, if I provide the model with some RGB image, and want the generated metric depth map to have the same resolution, by interpolating afterwards, should I just do the interpolation or also re-scale the depth map values by the resolution change? In general, even if I didn't change the depth map resolution, could I use and trust those metric values as they are generated, or should I do some focal length re-scaling depending on the RGB camera device I am using?

@DiTo97 Yes and yes you can trust it. An RGBD is an RGBD, You need to simply adjust for the pixelwise depth to the depth in 3D viewing from a point.

@1ssb Thank you for your contribution!
May I ask a question about the weight(xxx.pt) in your script is finetuning by your dataset? Could I load the original depthanything weight(xxxxx_vits14.pth)?

I have not checked with any other pretrained resource. Remember that this model is following the zoedepth style and not the relative scale metric.

thanks @1ssb, great contribution.
I tried your code and successfully got a .ply file, but how could I open it? Win10's default tool doesn't work with it.

I am glad it does, make sure the file is not corrupted. I generally use
Meshlab and it works well.
On Thu, 1 Feb, 2024, 3:21 pm John Doe, @.***> wrote:

thanks @1ssb https://github.com/1ssb, great contribution.
I tried your code and successfully got a .ply file, but how could I open
it? Win10's default tool doesn't work with it.
—
Reply to this email directly, view it on GitHub
https://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-1920477391,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJWHFEDUSZGS26LJJSG2YE3YRMJ4XAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRQGQ3TOMZZGE
.

For the NYU make sure you are setting nyu dataset flag to true for the
correct focal length which I have directly provided in the script. If you
are using your own fx and fy values, you will get a different distance from
the origin as expected.
On Fri, 2 Feb, 2024, 2:48 am Abhishek Pavani, @.***>
wrote:

@1ssb https://github.com/1ssb I took 4 images by keeping the object at
different distances from the camera (40cm,50cm,60cm and 70cm). I have the
camera intrinsics (FY =<PHONE_NUMBER>1766066 , FX =<PHONE_NUMBER>0166848). When
I use the NYU indoor checkpoint to test this with the code you provided,
the point cloud metric distances are not as accurate as real true
distances. Any thoughts on what could be going wrong?
40cm.jpg (view on web)
https://github.com/LiheYoung/Depth-Anything/assets/141050083/ce1e9fea-6823-432b-b5fd-87ab1773823e
50cm.jpg (view on web)
https://github.com/LiheYoung/Depth-Anything/assets/141050083/8829f38a-d5ef-4560-bcbc-6200ac58211d
60cm.jpg (view on web)
https://github.com/LiheYoung/Depth-Anything/assets/141050083/eb3b1234-faa2-4e26-8aec-4dd9af586152
70cm.jpg (view on web)
https://github.com/LiheYoung/Depth-Anything/assets/141050083/462d5ee6-70f0-4f72-8bd1-74171e43605c
—
Reply to this email directly, view it on GitHub
https://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-1921632395,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJWHFECF5SFOUV6KAKHUGK3YRO2MVAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRRGYZTEMZZGU
.
You are receiving this because you were mentioned.Message ID:
@.***>

Hi @1ssb, Thank you a lot for your tremendous efforts!

Can this be used to obtain depth or point cloud from a spherical panorama?

@DmitryPor could you clarify what you mean by spherical panorama?

@DmitryPorне могли бы вы уточнить, что вы подразумеваете под сферической панорамой?

Equirectangular 360-degree image
example zoedepth https://huggingface.co/spaces/shariqfarooq/ZoeDepth

@DmitryPorне могли бы вы уточнить, что вы подразумеваете под сферической панорамой?

Equirectangular 360-degree image example zoedepth https://huggingface.co/spaces/shariqfarooq/ZoeDepth

I guess not. spherical panorama is very different from perspective images. You can split a spherical panorama to cubic images and then use this model.

@1ssb I took 4 images by keeping the object at different distances from the camera (40cm,50cm,60cm and 70cm). I have the camera intrinsics (FY =<PHONE_NUMBER>1766066 , FX =<PHONE_NUMBER>0166848). When I use the NYU indoor checkpoint to test this with the code you provided, the point cloud metric distances are not as accurate as real true distances. Any thoughts on what could be going wrong?

Hi @abhishekmonogram,
Did you manage to get correct depth values (i.e., 40cm, 50cm, 60cm, and 70cm) from the indoor metric models? If yes, could you please how?

Hi, let me get in on this because this seems very relevant. A few things:

My script only converts the distance map to a depth map in 3D. So if the principal point depth is not accurate i.e. where the optical axis passes through the scene (no transformations applied) then there is nothing my script can help with. This is something you can easily verify by checking the depth at the midpoint index.

The depths are by extension not going to be perfect, that said the metric representation should be correct given the image being attributed to the specific context or model i.e. indoor/outdoor. There will be a bit of error because its at the end of day still a relative understanding agrregated over the metric representation that the model is learning.

Understand that deep learning nodels learn in distribution of data. If the data did not have certain edge cases it will probably not support it like obviously it has not been trained on panoramas so it will not give you a any good depth for that so make sure you infer over the same domain of data that the model was fed.

Finally, a good metric depth estimation will probably give you something which can well differentiate between 10cms of difference but that is also a bit of hit and miss. For metric depth by definition, the goal of the loss function is not responsible to give you correct to cm representation, it will give you correct to metre representation.

Hi, let me get in on this because this seems important to clarify. A few things:

My script only converts the distance map to a depth map in 3D. So if the principal point depth is not accurate i.e. where the optical axis passes through the scene (no transformations applied) then there is nothing my script can help with. This is something you can easily verify by checking the depth at the midpoint index.
The depths are by extension not going to be perfect, that said the metric representation should be correct given the image being attributed to the specific context or model i.e. indoor/outdoor. There will be a bit of error because its at the end of day still a relative understanding agrregated over the metric representation that the model is learning.
Understand that deep learning models learn in distribution of data. If the data did not have certain cases it will probably not support it like obviously it has not been trained on panoramas so it will not give you any good depth for that so make sure you infer over the same domain of data that the model was fed.
Finally, a perfect metric depth estimation will probably give you something which can well differentiate between 10cms of difference but that is also a bit of hit and miss. For metric depth by definition, the goal of the loss function is not responsible to give you correct to cm representation, it will give you correct to metre representation. While there is nothing stopping it from learning that but there is always the mean aggregation over scenes which will prevent overfitting.

Hi @1ssb, @LiheYoung,
Many thanks for your reply.
It's understandable that the network is trained on full resolution KITTI and is expected to deliver good results on this specific set. However; what's the point of training a depth estimation network? You might use it for the pictures you get from your own camera, right?
Let me give you an example. I tried the metric depth-anything on the pre-trained outdoor (KITTI) in three different settings, on the KITTI_Evaluation_set, containing 1000 images (you can download it from the official KITTI website: https://s3.eu-central-1.amazonaws.com/avg-kitti/data_depth_selection.zip):
1- Applied network on full resolution images (1216x352), then compared the output with ground truth -> RMSE=~2 meters
2- Crop the center of images to get 512x352, applied network on the cropped images, and compared the output with ground truth -> RMSE=~4 meters
3- Crop the center of images to get 512x288, applied network on the cropped images, and compared the output with ground truth -> RMSE=~6 meters
All of the tested images are KITTI contents with the same focal length (no image resize), just filed of view is changed (by cropping). Probably, if I use a different content I would get much worse results.
The question is still valid: is it possible to use this network for an arbitrary image? If yes, how to compensate for different focal length and field of view?
I have trained a network my self (based on Mobilenet-V2). I know the details of my training. I also found how to adapt for the focal length difference (in my network, a resizing is required before feeding the image into the network), and different field of view. If you give me an arbitrary image, I know how to get correct depth map out of my network. I want to know how to get the same from depth-aynthing.

@hgolestaniii congratulations then you have made a distinct scientific finding which you should publish making sure indeed that you can claim this over both indoor and outdoor data to proclaim that you do better than this model. Also make sure that you are using this current set up correctly and appropriately. Looking forward to your work.

@1ssb thanks. My network is designed to be lite for edge devices. I can't say it performs better than depth-aynthing, but my metric performance results are not far from depth-anything. At least, in my network, its clear how to use it for an image with different resolution and focal length than KITTI. I guess, someone who knows the details of this algorithm can tell us how to get depth-aynthing worked for an arbitrary image. Probably @LiheYoung can help in this step.

Hi, let me get in on this because this seems important to clarify. A few things:

My script only converts the distance map to a depth map in 3D. So if the principal point depth is not accurate i.e. where the optical axis passes through the scene (no transformations applied) then there is nothing my script can help with. This is something you can easily verify by checking the depth at the midpoint index.
The depths are by extension not going to be perfect, that said the metric representation should be correct given the image being attributed to the specific context or model i.e. indoor/outdoor. There will be a bit of error because its at the end of day still a relative understanding agrregated over the metric representation that the model is learning.
Understand that deep learning models learn in distribution of data. If the data did not have certain cases it will probably not support it like obviously it has not been trained on panoramas so it will not give you any good depth for that so make sure you infer over the same domain of data that the model was fed.
Finally, a perfect metric depth estimation will probably give you something which can well differentiate between 10cms of difference but that is also a bit of hit and miss. For metric depth by definition, the goal of the loss function is not responsible to give you correct to cm representation, it will give you correct to metre representation. While there is nothing stopping it from learning that but there is always the mean aggregation over scenes which will prevent overfitting.

Hi @1ssb, @LiheYoung,
Many thanks for your reply.
It's understandable that the network is trained on full resolution KITTI and is expected to deliver good results on this specific set. However; what's the point of training a depth estimation network? You might use it for the pictures you get from your own camera, right?
Let me give you an example. I tried the metric depth-anything on the pre-trained outdoor (KITTI) in three different settings, on the KITTI_Evaluation_set, containing 1000 images (you can download it from the official KITTI website: https://s3.eu-central-1.amazonaws.com/avg-kitti/data_depth_selection.zip):
1- Applied network on full resolution images (1216x352), then compared the output with ground truth -> RMSE=~2 meters 2- Crop the center of images to get 512x352, applied network on the cropped images, and compared the output with correspondingly cropped ground truth -> RMSE=~4 meters 3- Crop the center of images to get 512x288, applied network on the cropped images, and compared the output with correspondingly cropped ground truth -> RMSE=~6 meters
All of the tested images are KITTI contents with the same focal length (no image resize), just filed of view is changed (by cropping). Probably, if I use a different content I would get much worse results.
The question is still valid: is it possible to use this network for an arbitrary image? If yes, how to compensate for different focal length and field of view?
I have trained a network my self (based on Mobilenet-V2). I know the details of my training. I also found how to adapt for the focal length difference (in my network, a resizing is required before feeding the image into the network), and different field of view. If you give me an arbitrary image, I know how to get correct depth map out of my network. I want to know how to get the same from depth-aynthing.

You may find this paper interesting.
Abstract: "It has long been an ill-posed problem to predict absolute depth maps from single images in real (unseen) indoor scenes. We observe that it is essentially due to not only the scale-ambiguous problem but also the focal-ambiguous problem that decreases the generalization ability of monocular depth estimation. That is, images may be captured by cameras of different focal lengths in scenes of different scales. In this paper, we develop a focal-and-scale depth estimation model to well learn absolute depth maps from single images in unseen indoor scenes."

Hi @MalekWahidi as far as I know rhis is very much an unsolved problem.

Hi @MalekWahidi as far as I know this is still very much an unsolved problem and undeployably experimental. Thanks for the paper!

Actually, I think Google recently made significant progress on this front with there new DMD model. But it's such a shame they didn't publish any code for this one. I guess some crossover between what they did in this paper and Depth Anything would make a really promising approach for generalizable monocular metric depth estimation.

@MalekWahidi indeed I have come across this paper but the sheer amount of training and 33% better shots seem incoherent in terms of deployability. A simple test is to take a stereo pair and see if its 3D consistent upon two inferences, and repeat it for any camera of choice which most methods including DepthAnything fail at. Its a much fairer metric than predicting exact depths because frankly if depths are really that important any practical person would use an RGBD cam.

@MalekWahidi indeed I have come across this paper but the sheer amount of training and 33% better shots seem incoherent in terms of deployability. A simple test is to take a stereo pair (transform the point clouds and combine them) and see if its 3D consistent upon two inferences, and repeat it for any camera of choice which most methods including DepthAnything fail at. Its a much fairer metric than predicting exact depths because frankly if depths are really that important any practical person would use an RGBD cam.

I didn't quite understand ur first statement. And regarding point cloud/metric depth consistency across multiple inference steps, I guess some form of temporal smoothing should work? Current RGBD cams are notoriously noisy as well.

@MalekWahidi sorry my bad. True RGBD cameras are noisy but calibration is far more straight forward and so is outlier culling. These things on the other hand are far less trustworthy.
Well I am not sure what you mean by temporal smoothing. The idea is to perfect the overlapping point matching to a 3D procrustes error to zero.

I have run the code in depth_to_pointcloud.py, but I found that the real depth is 2 times than real image, after estimate_depth2, the RMSE(real_depth,2estimate_depth) is around 150mm, math the result in paper.
By the way, I want to know whether the depth_to_pointcloud can be deployed in openvino?

Hmm "but I found that the real depth is 2 times than real image, after estimate_depth2": this seems like a systemic problem and should not be happening if it's an indoor scene. Correct for the focal plane values. And compare the principal point depth with the real depth first.

Hmm "but I found that the real depth is 2 times than real image, after estimate_depth2": this seems like a systemic problem and should not be happening if it's an indoor scene. Correct for the focal plane values. And compare the principal point depth with the real depth first.
Also, can you post the RGBD here

Thanks a lot! and here is my code reference depth_to_pointcloud.py, only change in process_images() function
def process_images(model):
    color_image=Image.open("color_0.png").convert('RGB')
    original_width, original_height = color_image.size
    image_tensor = transforms.ToTensor()(color_image).unsqueeze(0).to('cuda' if torch.cuda.is_available() else 'cpu')

    pred = model(image_tensor, dataset=DATASET)
    if isinstance(pred, dict):
        pred = pred.get('metric_depth', pred.get('out'))
    elif isinstance(pred, (list, tuple)):
        pred = pred[-1]
    pred = pred.squeeze().detach().cpu().numpy()
    resized_pred = Image.fromarray(pred).resize((original_width, original_height), Image.NEAREST)

    np_resized_pred=np.array(resized_pred)
    np_resized_pred=np_resized_pred*1000
    np_resized_pred=np_resized_pred.astype(np.int16)

    with open("depth_0.png", 'wb') as f:#对于png文件,专门采用了png文件的保存方式
        writer = png.Writer(width=np_resized_pred.shape[1], height=np_resized_pred.shape[0],
                            bitdepth=16, greyscale=True)
        zgray2list = np_resized_pred.tolist()
        writer.write(f, zgray2list)

Hmm bot sure. My first shot understanding is that you are resizing it in an ambiguous way. Go through my code once again and check if you need resizing and adapt the focal length scale. Also the depth map needs to be compared to in uint16 format in an array. My suggestion is save an npy file out of the prediction after concatenation with the rgb and check the prediction of yhe principal point for bothe RGBD and the prediction RGBD. I will check more deeply in sometime and get back.

Congratulations for the great effort, all of you!
Something worth mentioning here. @1ssb in the depth_to_pointcloud.py script at the lines 55 and 56 where the image plane coordinates are transformed to camera coordinates, would not be better if instead of this
            x = (x - FINAL_WIDTH / 2) / focal_length_x
            y = (y - FINAL_HEIGHT / 2) / focal_length_y

we have this:
            x = (x - CX) / focal_length_x
            y = (y - CY) / focal_length_y

where CX and CY are the pixel coordinates of the principal point (in pixels) ?
The principal point is not exactly in the middle of the image plane so maybe this change increase the accuracy overall. Correct me if I am wrong

Yes, you are right. Feel free to do that. For my implementation I ended up
always using square images and hence such a simplification.
On Fri, 15 Mar, 2024, 2:09 am karantai, @.***> wrote:

Congratulations for the great effort, all of you!
Something worth mentioning here. @1ssb https://github.com/1ssb in the
depth_to_pointcloud.py script at the lines 55 and 56 where the image
plane coordinates are transformed to camera coordinates, would not be
better if instead of this
        x = (x - FINAL_WIDTH / 2) / focal_length_x
        y = (y - FINAL_HEIGHT / 2) / focal_length_y

we have this:
        x = (x - CX) / focal_length_x
        y = (y - CY) / focal_length_y

where CX and CY are the pixel coordinates of the principal point (in
pixels) ?
The principal point is not exactly in the middle of the image plane so
maybe this change increase the accuracy overall. Correct me if I am wrong
—
Reply to this email directly, view it on GitHub
https://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-1997680338,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJWHFEEQJBJZ2OOL2HJSPXDYYG4SLAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJXGY4DAMZTHA
.
You are receiving this because you were mentioned.Message ID:
@.***>

So, the depth_to_pointcloud.py generates a point cloud, which takes into account both scale and focal length into account in order for the depth metric to be "truly" correct, like the work that have been done here?

No, in the work the focal params are also learnt and predicted, here you know the intrinsics already.

Hi @LiheYoung I am indeed using the metric depth and the point cloud I have uploaded is indeed from the zoedepth. Can you kindly confirm that if these values of depth are for example 4.35 metres etc, they are indeed in metres wothout any need for further analysis/transformation?
…
On Sat, 27 Jan, 2024, 10:15 am Lihe Yang, @.> wrote: Hi @1ssb https://github.com/1ssb , our Depth Anything models primarily focus on relative depth estimation. Thus, the output value from the HuggingFace published models does not represent any metric meanings. However, if you want to obtain metric depth information (in meters), you can use our models introduced here: https://github.com/LiheYoung/Depth-Anything/tree/main/metric_depth, just like @loevlie https://github.com/loevlie mentioned. — Reply to this email directly, view it on GitHub <#36 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJWHFEDBCBTCPDR2TMZLWYDYQSA7ZAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSHE4DOMJSGA . You are receiving this because you were mentioned.Message ID: @.>

Pretty good on visualisation. @LiheYoung is it possible to confirm that the depths say 4.54 is in metres and there are no additional scales at play?

@1ssb How were you able to get the depth value, i.e 4.54 meters? I am able to the generate the point cloud map; however, I am unsure how to get the depth value.

By saving the tensor array output from the depth anything model itself.
On Tue, 9 Apr, 2024, 6:10 am Aditya, @.***> wrote:

Hi @LiheYoung https://github.com/LiheYoung I am indeed using the metric
depth and the point cloud I have uploaded is indeed from the zoedepth. Can
you kindly confirm that if these values of depth are for example 4.35
metres etc, they are indeed in metres wothout any need for further
analysis/transformation?
… <#m_-6946876434900797959_>
On Sat, 27 Jan, 2024, 10:15 am Lihe Yang, @.> wrote: Hi @1ssb
https://github.com/1ssb https://github.com/1ssb https://github.com/1ssb
, our Depth Anything models primarily focus on relative depth estimation.
Thus, the output value from the HuggingFace published models does not
represent any metric meanings. However, if you want to obtain metric depth
information (in meters), you can use our models introduced here:
https://github.com/LiheYoung/Depth-Anything/tree/main/metric_depth
https://github.com/LiheYoung/Depth-Anything/tree/main/metric_depth, just
like @loevlie https://github.com/loevlie https://github.com/loevlie
https://github.com/loevlie mentioned. — Reply to this email directly,
view it on GitHub <#36 (comment)
https://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-1912987120>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJWHFEDBCBTCPDR2TMZLWYDYQSA7ZAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSHE4DOMJSGA
https://github.com/notifications/unsubscribe-auth/AJWHFEDBCBTCPDR2TMZLWYDYQSA7ZAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSHE4DOMJSGA
. You are receiving this because you were mentioned.Message ID: @.>
[image: Screenshot 2024-01-26 at 10 21 10 PM]
https://private-user-images.githubusercontent.com/40661648/300050173-fd4f8b9e-af42-4ac1-b113-d2ed40ef1b27.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTI2MDM0NzYsIm5iZiI6MTcxMjYwMzE3NiwicGF0aCI6Ii80MDY2MTY0OC8zMDAwNTAxNzMtZmQ0ZjhiOWUtYWY0Mi00YWMxLWIxMTMtZDJlZDQwZWYxYjI3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA0MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNDA4VDE5MDYxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZhMzM2NGQzMzg5NzJlNjBlZDA2Zjg1MTIxOTQ0NDU2YmM5YmNiYjliZGMxYjgxZmRhNDdiODllYTdjMWQ1OGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.HqBC5uc7Dfyht3jYMAXsP9didXNZBN8qK6-IuPW6NnI
Pretty good on visualisation. @LiheYoung https://github.com/LiheYoung
is it possible to confirm that the depths say 4.54 is in metres and there
are no additional scales at play?
@1ssb https://github.com/1ssb How were you able to get the depth value,
i.e 4.54 meters? I am able to the generate the point cloud map; however, I
am unsure how to get the depth value.
—
Reply to this email directly, view it on GitHub
https://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-2043557658,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJWHFEF23SJSJZWCH6IER33Y4L2UZAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBTGU2TONRVHA
.
You are receiving this because you were mentioned.Message ID:
@.***>

Hi @1ssb, could you provide detailed information as you mentioned obtaining a value of 4.54 meters by saving depth? From my understanding, the output of depth anything is a 2D matrix. Can we infer that the depth anything output tensor already provides the actual output, and zoedepth is used for point cloud visualization? Thanks for your time!

My code simply transforms the 2D output to a 3D point cloud. Its just
geometrically placing it along the rays.
On Wed, 24 Apr, 2024, 8:19 pm abo-galaxy, @.***> wrote:

Hi @1ssb https://github.com/1ssb, could you provide detailed
information as you mentioned obtaining a value of 4.54 meters by saving
depth? From my understanding, the output of depth anything is a 2D matrix.
Can we infer that the depth anything output tensor already provides the
actual output, and zoedepth is used for point cloud visualization? Thanks
for your time!
—
Reply to this email directly, view it on GitHub
https://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-2074612806,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJWHFEBP52FI66K437WSR7DY66BLXAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZUGYYTEOBQGY
.
You are receiving this because you were mentioned.Message ID:
@.***>

https://github.com//issues/85

您好，您对齐不同相机的数据是否是采用了大疆的Metric3D论文的做法？采用规范化相机来统一？

嗨，让我来谈谈这个问题，因为澄清这一点似乎很重要。一些东西：

我的脚本仅将距离图转换为 3D 深度图。因此，如果主点深度不准确，即光轴穿过场景的位置（未应用变换），那么我的脚本没有任何帮助。您可以通过检查中点索引处的深度轻松验证这一点。
通过扩展，深度不会是完美的，也就是说，考虑到图像归因于特定的上下文或模型（即室内/室外），度量表示应该是正确的。会有一些错误，因为最终仍然是对模型正在学习的度量表示的相对理解。
了解深度学习模型在数据分布中学习。如果数据没有某些情况，它可能不会支持它，显然它还没有接受过全景图训练，因此它不会为您提供任何良好的深度，因此请确保您推断出模型所输入的相同数据域。
最后，一个完美的公制深度估计可能会给你一些可以很好区分 10 厘米差异的东西，但这也有点碰运气。对于定义的度量深度，损失函数的目标不负责为您提供正确的厘米表示，而是为您提供正确的米表示。虽然没有什么可以阻止它学习这一点，但场景上总是存在平均聚合，这将防止过度拟合。

你好@1ssb,@LiheYoung,
非常感谢您的回复。
可以理解的是，该网络是在全分辨率 KITTI 上进行训练的，并且有望在此特定集上提供良好的结果。然而;训练深度估计网络有什么意义？您可能会用它来拍摄从您自己的相机中获得的照片，对吧？
让我举一个例子。我在预训练的户外（KITTI）上尝试了三种不同设置的度量深度-任何东西，在 KITTI_Evaluation_set 上，包含 1000 张图像（您可以从 KITTI 官方网站下载：https://s3.eu-central-1 .amazonaws.com/avg-kitti/data_depth_selection.zip）：
1- 在全分辨率图像 (1216x352) 上应用网络，然后将输出与地面实况进行比较 -> RMSE=~2 米 2- 裁剪图像中心以获得 512x352，在裁剪后的图像上应用网络，并将输出与相应的进行比较裁剪后的地面实况 -> RMSE=~4 米 3- 裁剪图像中心以获得 512x288，在裁剪后的图像上应用网络，并将输出与相应裁剪的地面实况进行比较 -> RMSE=~6 米
所有测试图像都是具有相同焦距的 KITTI 内容（没有调整图像大小），只是改变了视野（通过裁剪）。也许，如果我使用不同的内容，我会得到更糟糕的结果。
问题仍然有效：是否可以将该网络用于任意图像？如果是，如何补偿不同的焦距和视场？
我自己训练了一个网络（基于Mobilenet-V2）。我知道我的训练细节。我还找到了如何适应焦距差异（在我的网络中，在将图像输入网络之前需要调整大小）和不同的视野。如果你给我一个任意图像，我知道如何从我的网络中获取正确的深度图。我想知道如何从深度 aynthing 中获得相同的结果。

您好，您对齐不同相机的数据是否是采用了大疆的Metric3D论文的做法？采用规范化相机来统一？

Hi, really sorry I do not know Mandarin, can you post a translation?
On Mon, 6 May, 2024, 5:31 pm puyiwen, @.***> wrote:

嗨，让我来谈谈这个问题，因为澄清这一点似乎很重要。一些东西：

我的脚本仅将距离图转换为 3D
深度图。因此，如果主点深度不准确，即光轴穿过场景的位置（未应用变换），那么我的脚本没有任何帮助。您可以通过检查中点索引处的深度轻松验证这一点。

通过扩展，深度不会是完美的，也就是说，考虑到图像归因于特定的上下文或模型（即室内/室外），度量表示应该是正确的。会有一些错误，因为最终仍然是对模型正在学习的度量表示的相对理解。
3.
了解深度学习模型在数据分布中学习。如果数据没有某些情况，它可能不会支持它，显然它还没有接受过全景图训练，因此它不会为您提供任何良好的深度，因此请确保您推断出模型所输入的相同数据域。
4. 最后，一个完美的公制深度估计可能会给你一些可以很好区分 10
厘米差异的东西，但这也有点碰运气。对于定义的度量深度，损失函数的目标不负责为您提供正确的厘米表示，而是为您提供正确的米表示。虽然没有什么可以阻止它学习这一点，但场景上总是存在平均聚合，这将防止过度拟合。
@.*** @.***
https://github.com/LiheYoung,
非常感谢您的回复。
可以理解的是，该网络是在全分辨率 KITTI
上进行训练的，并且有望在此特定集上提供良好的结果。然而;训练深度估计网络有什么意义？您可能会用它来拍摄从您自己的相机中获得的照片，对吧？
让我举一个例子。我在预训练的户外（KITTI）上尝试了三种不同设置的度量深度-任何东西，在 KITTI_Evaluation_set 上，包含
1000 张图像（您可以从 KITTI 官方网站下载：https://s3.eu-central-1
.amazonaws.com/avg-kitti/data_depth_selection.zip http://url）：
1- 在全分辨率图像 (1216x352) 上应用网络，然后将输出与地面实况进行比较 -> RMSE=~2 米 2- 裁剪图像中心以获得
512x352，在裁剪后的图像上应用网络，并将输出与相应的进行比较裁剪后的地面实况 -> RMSE=~4 米 3- 裁剪图像中心以获得
512x288，在裁剪后的图像上应用网络，并将输出与相应裁剪的地面实况进行比较 -> RMSE=~6 米
所有测试图像都是具有相同焦距的 KITTI 内容（没有调整图像大小），只是改变了视野（通过裁剪）。也许，如果我使用不同的内容，我会得到更糟糕的结果。
问题仍然有效：是否可以将该网络用于任意图像？如果是，如何补偿不同的焦距和视场？
我自己训练了一个网络（基于Mobilenet-V2）。我知道我的训练细节。我还找到了如何适应焦距差异（在我的网络中，在将图像输入网络之前需要调整大小）和不同的视野。如果你给我一个任意图像，我知道如何从我的网络中获取正确的深度图。我想知道如何从深度
aynthing 中获得相同的结果。
您好，您对齐不同相机的数据是否是采用了大疆的Metric3D论文的做法？采用规范化相机来统一？
—
Reply to this email directly, view it on GitHub
https://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-2095358353,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJWHFEEMUYDYYF6M6PUAK2TZA4WW5AVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJVGM2TQMZVGM
.
You are receiving this because you were mentioned.Message ID:
@.***>

Hi, really sorry I do not know Mandarin, can you post a translation?
…
On Mon, 6 May, 2024, 5:31 pm puyiwen, @.> wrote: 嗨，让我来谈谈这个问题，因为澄清这一点似乎很重要。一些东西： 1. 我的脚本仅将距离图转换为 3D 深度图。因此，如果主点深度不准确，即光轴穿过场景的位置（未应用变换），那么我的脚本没有任何帮助。您可以通过检查中点索引处的深度轻松验证这一点。 2. 通过扩展，深度不会是完美的，也就是说，考虑到图像归因于特定的上下文或模型（即室内/室外），度量表示应该是正确的。会有一些错误，因为最终仍然是对模型正在学习的度量表示的相对理解。 3. 了解深度学习模型在数据分布中学习。如果数据没有某些情况，它可能不会支持它，显然它还没有接受过全景图训练，因此它不会为您提供任何良好的深度，因此请确保您推断出模型所输入的相同数据域。 4. 最后，一个完美的公制深度估计可能会给你一些可以很好区分 10 厘米差异的东西，但这也有点碰运气。对于定义的度量深度，损失函数的目标不负责为您提供正确的厘米表示，而是为您提供正确的米表示。虽然没有什么可以阻止它学习这一点，但场景上总是存在平均聚合，这将防止过度拟合。 @. @.*** https://github.com/LiheYoung, 非常感谢您的回复。 可以理解的是，该网络是在全分辨率 KITTI 上进行训练的，并且有望在此特定集上提供良好的结果。然而;训练深度估计网络有什么意义？您可能会用它来拍摄从您自己的相机中获得的照片，对吧？ 让我举一个例子。我在预训练的户外（KITTI）上尝试了三种不同设置的度量深度-任何东西，在 KITTI_Evaluation_set 上，包含 1000 张图像（您可以从 KITTI 官方网站下载：https://s3.eu-central-1 .amazonaws.com/avg-kitti/data_depth_selection.zip http://url）： 1- 在全分辨率图像 (1216x352) 上应用网络，然后将输出与地面实况进行比较 -> RMSE=~2 米 2- 裁剪图像中心以获得 512x352，在裁剪后的图像上应用网络，并将输出与相应的进行比较裁剪后的地面实况 -> RMSE=~4 米 3- 裁剪图像中心以获得 512x288，在裁剪后的图像上应用网络，并将输出与相应裁剪的地面实况进行比较 -> RMSE=~6 米 所有测试图像都是具有相同焦距的 KITTI 内容（没有调整图像大小），只是改变了视野（通过裁剪）。也许，如果我使用不同的内容，我会得到更糟糕的结果。 问题仍然有效：是否可以将该网络用于任意图像？如果是，如何补偿不同的焦距和视场？ 我自己训练了一个网络（基于Mobilenet-V2）。我知道我的训练细节。我还找到了如何适应焦距差异（在我的网络中，在将图像输入网络之前需要调整大小）和不同的视野。如果你给我一个任意图像，我知道如何从我的网络中获取正确的深度图。我想知道如何从深度 aynthing 中获得相同的结果。 您好，您对齐不同相机的数据是否是采用了大疆的Metric3D论文的做法？采用规范化相机来统一？ — Reply to this email directly, view it on GitHub <#36 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJWHFEEMUYDYYF6M6PUAK2TZA4WW5AVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJVGM2TQMZVGM . You are receiving this because you were mentioned.Message ID: @.***>

I am so sorry, I replied to the wrong person. I will delete it and reply again.

Hi, @hgolestaniii. Do you align the data of different cameras using the method in DJI's Metric3D paper? Do you use normalized cameras to unify?

Hi, @1ssb @LiheYoung. I'm so sorry to bother you. May I ask you a question about how to do prediction with this metrics depth model?, my goal is to get the closest value in meters for my iot project. Because the code in the rep is only did the evaluation. When i try to make prediction code for this model, i got lost when learning about all different configs is, and also i only, want to get prediction from 1 input image, not in batches. I am a beginner and still have a lot more to learn. I'd be so happy if anyone could help me regarding this matters.

Hey, if you need help with the use, you can mail me directly at @.***
Best
Subhransu

From: sinskyy @.>
Sent: Tuesday, June 11, 2024 10:50:09 PM
To: LiheYoung/Depth-Anything @.>
Cc: Subhransu Bhattacharjee @.>; Mention @.>
Subject: Re: [LiheYoung/Depth-Anything] true metric depth values (Issue #36)
Hi, @1ssbhttps://github.com/1ssb @LiheYounghttps://github.com/LiheYoung. I'm so sorry to bother you. May I ask you a question about how to do prediction with this metrics depth model?, my goal is to get the closest value in meters for my iot project. Because the code in the rep is only did the evaluation. When i try to make prediction code for this model, i got lost when learning about all different configs is, and also i only, want to get prediction from 1 input image, not in batches. I am a beginner and still have a lot more to learn. I'd be so happy if anyone could help me regarding this matters.
—
Reply to this email directly, view it on GitHubhttps://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-2160681770, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJWHFEEDR6BCHPFHQW7PDM3ZG3XADAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRQGY4DCNZXGA.
You are receiving this because you were mentioned.Message ID: @.***>

@1ssb @LiheYoung Hello, I currently do not have absolute depth data for my own scene, but I hope to use the relative depth map predicted by depth anything to find a way to obtain an absolute depth map. Is there any direct method? For example, using the least squares method, the relative depth difference between two points in a relative depth map can be calculated, and then the absolute depth difference between these two points can be calculated to determine how many meters a pixel represents in a relative depth map?

Use metric depths instead and use plug and play methods to get local approximates for control/interest points.
Best
Subhransu

From: Wei Hongwei @.>
Sent: Friday, June 21, 2024 7:03:47 PM
To: LiheYoung/Depth-Anything @.>
Cc: Subhransu Bhattacharjee @.>; Mention @.>
Subject: Re: [LiheYoung/Depth-Anything] true metric depth values (Issue #36)
@1ssbhttps://github.com/1ssb @LiheYounghttps://github.com/LiheYoung Hello, I currently do not have absolute depth data for my own scene, but I hope to use the relative depth map predicted by depth anything to find a way to obtain an absolute depth map. Is there any direct method? For example, using the least squares method, the relative depth difference between two points in a relative depth map can be calculated, and then the absolute depth difference between these two points can be calculated to determine how many meters a pixel represents in a relative depth map?
—
Reply to this email directly, view it on GitHubhttps://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-2182332569, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJWHFEDF2CGUOGADIN5K43DZIPT7HAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBSGMZTENJWHE.
You are receiving this because you were mentioned.Message ID: @.***>

No general methods, heavily dependent on hat you are doing exactly.
Best
Subhransu

From: Wei Hongwei @.>
Sent: Friday, June 21, 2024 7:11:57 PM
To: LiheYoung/Depth-Anything @.>
Cc: Subhransu Bhattacharjee @.>; Mention @.>
Subject: Re: [LiheYoung/Depth-Anything] true metric depth values (Issue #36)
Use metric depths instead and use plug and play methods to get local approximates for control/interest points. Best Subhransu
Thank you for your reply. Are there any specific methods and links
—
Reply to this email directly, view it on GitHubhttps://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-2182347840, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJWHFEBWWAYSSS42VYKLB3TZIPU53AVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBSGM2DOOBUGA.
You are receiving this because you were mentioned.Message ID: @.***>

I have seen some discussions in this area under Midas, and I will first try their methods. https://github.com/isl-org/MiDaS/issues/171

does the out from the metric depth give us absolute depth (or disparity as in case of relative depth estimation)?  @1ssb
Also, can you tell how you convert points in 2d to 3d? is there some derivation for it which you can share?

Hello @Nd-sole, I do not consider this space for clarifications. Either raise this in a discussion or kindly mail me at<EMAIL_ADDRESS>if you are confused with the ideas.

@1ssb Hello, thanks for your code I generated 3d point clouds of my images, but I have some questions that I wanted to query,  for example, the following code:
            resized_color_image = color_image.resize((FINAL_WIDTH, FINAL_HEIGHT), Image.LANCZOS)
            resized_pred = Image.fromarray(pred).resize((FINAL_WIDTH, FINAL_HEIGHT), Image.NEAREST)

If I input images 1920*1536, what are the benefits of getting different output sizes? Since I want to get the metric depth estimation of my input images, and I want to compare it with my original point clouds of the scene. In this situation, I suppose I'd get the output size the same as its inputs, but the deviations are obvious(the original pc and estimated pc are under the same coordinates). Is there anything that I might miss while using your code? I modified the FINAL_WIDTH, and FINAL_HEIGHT to my paras and added CX and CY, btw I'm not sure if you checked the latest version of your code modified by the author in depth anything v2  since I used this code. I was wondering if there is anything that I need to pay special attention while using the code to realize my purpose to generate the exact estimation. If anything above seems incorrect, please kindly let me know about it, thanks!

I have repeated this a number of times. There are no connotations to this. In case you have not noticed I have not authored this work, simply contributed the script.
It was simply the set up I am using that I use for my own work. It is up to you to replace it for your own set up.
Best
Subhransu

From: EdricHe @.>
Sent: Friday, July 5, 2024 12:54:52 AM
To: LiheYoung/Depth-Anything @.>
Cc: Subhransu Bhattacharjee @.>; Mention @.>
Subject: Re: [LiheYoung/Depth-Anything] true metric depth values (Issue #36)
@1ssbhttps://github.com/1ssb Hello, thanks for your code I generated 3d point clouds of my images, but I have some questions that I wanted to query, for example, the following code:
        resized_color_image = color_image.resize((FINAL_WIDTH, FINAL_HEIGHT), Image.LANCZOS)
        resized_pred = Image.fromarray(pred).resize((FINAL_WIDTH, FINAL_HEIGHT), Image.NEAREST)

If I input images 1920*1536, what are the benefits of getting different output sizes? Since I want to get the metric depth estimation of my input images, and I want to compare it with my original point clouds of the scene. In this situation, I suppose I'd get the output size the same as its inputs, but the deviations are obvious(the original pc and estimated pc are under the same coordinates). Is there anything that I might miss while using your code? I modified the FINAL_WIDTH, and FINAL_HEIGHT to my paras and added CX and CY, btw I'm not sure if you checked the latest version of your code modified by the author in depth anything v2https://github.com/DepthAnything/Depth-Anything-V2/blob/main/metric_depth/depth_to_pointcloud.py since I used this code. I was wondering if there is anything that I need to pay special attention while using the code to realize my purpose to generate the exact estimation. If anything above seems incorrect, please kindly let me know about it, thanks!
—
Reply to this email directly, view it on GitHubhttps://github.com/LiheYoung/Depth-Anything/issues/36#issuecomment-2209176484, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJWHFEENZ6IHG3EWFTHVHYTZKVO3ZAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZGE3TMNBYGQ.
You are receiving this because you were mentioned.Message ID: @.***>

I have repeated this a number of times. There are no connotations to this. In case you have not noticed I have not authored this work, simply contributed the script. It was simply the set up I am using that I use for my own work. It is up to you to replace it for your own set up. Best Subhransu
…
________________________________ From: EdricHe @.> Sent: Friday, July 5, 2024 12:54:52 AM To: LiheYoung/Depth-Anything @.> Cc: Subhransu Bhattacharjee @.>; Mention @.> Subject: Re: [LiheYoung/Depth-Anything] true metric depth values (Issue #36) @1ssbhttps://github.com/1ssb Hello, thanks for your code I generated 3d point clouds of my images, but I have some questions that I wanted to query, for example, the following code: resized_color_image = color_image.resize((FINAL_WIDTH, FINAL_HEIGHT), Image.LANCZOS) resized_pred = Image.fromarray(pred).resize((FINAL_WIDTH, FINAL_HEIGHT), Image.NEAREST) If I input images 19201536, what are the benefits of getting different output sizes? Since I want to get the metric depth estimation of my input images, and I want to compare it with my original point clouds of the scene. In this situation, I suppose I'd get the output size the same as its inputs, but the deviations are obvious(the original pc and estimated pc are under the same coordinates). Is there anything that I might miss while using your code? I modified the FINAL_WIDTH, and FINAL_HEIGHT to my paras and added CX and CY, btw I'm not sure if you checked the latest version of your code modified by the author in depth anything v2https://github.com/DepthAnything/Depth-Anything-V2/blob/main/metric_depth/depth_to_pointcloud.py since I used this code. I was wondering if there is anything that I need to pay special attention while using the code to realize my purpose to generate the exact estimation. If anything above seems incorrect, please kindly let me know about it, thanks! — Reply to this email directly, view it on GitHub<#36 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJWHFEENZ6IHG3EWFTHVHYTZKVO3ZAVCNFSM6AAAAABCK3CZBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZGE3TMNBYGQ. You are receiving this because you were mentioned.Message ID: @.**>

Thanks for your reply, really appreciate it

It works good.
I have a question.
If the real depth value of some areas of the converted metric depth image is defined, is it possible to implement the entire image close to the real depth image by applying the relative depth value to the rest of the area?


Add connect framework

I hope it's OK, but figured I'd add the connect framework to the list here. 7.4k stars on GitHub and it's the low overhead version of Express.js for the most part. Users who don't need the Express.js sugar simply use connect (and + the rotuer if they want router -- can use other routers too, but most use the Express-like one).

We can prepare an infrastructure to compare this project with web packages on node js. Thank you for adding the connect package.


Add service priority flag to kgs template cluster

Towards https://github.com/giantswarm/giantswarm/issues/22334
As the creator of a pull request, please consider:

[ ] Describe the goal you are trying to accomplish here, above the line.
[ ] Add a user-friendly description of your change to CHANGELOG.md.
[ ] Provide a link to the issue you are solving or working towards, if available.
[ ] Request SIG UX for review. They care about almost all user-facing changes.
[ ] Update the public kubectl-gs documentation to reflect the changes here.
[ ] add the breaking-change label to the PR if the change you are making changes the existing behaviour. Examples: removal of a flag, removal of a command, change of a default value. (Such changes should be released with a major version bump.)

Feel free to remove this checklist when done.

Just checking my understanding, we don't want to allow setting this label using the --label flag until the Kyverno policy is in place, right?

I think it is possible to do this, right? (Unless it is blocked by another admission controller maybe)
However, we did not want to encourage it before having the policy in place.

Just checking my understanding, we don't want to allow setting this label using the --label flag until the Kyverno policy is in place, right?

I think it is possible to do this, right? (Unless it is blocked by another admission controller maybe) However, we did not want to encourage it before having the policy in place.

Thank you for explaining! I noticed we can't set labels with the substring giantswarm.io at the moment with the --label flag, but I wasn't sure if that was the intended effect. If I run the command with --label="giantswarm.io/service-priority=highest I see:
Error: Invalid flag: --label must contain valid label definitions (invalid label key error: "giantswarm.io/service-priority=highest": containing forbidden substring 'giantswarm.io')

Ah yeah I guess that is the existing validation.


Edited README.rst

The README is equal parts tutorial as it is an explanation for how this module works.

Few quick questions. Is the idea to keep the test_aiologin.py? maybe rename it to something like sample.py? Also remove all of the print statements. I don't think that someone running that sample will like the print samples.

I've made the changes, do you see them in the pull request or do I need to make a new one?

No need. I could see the changes right here. I merged your pull request. Already looks so much sweeter.