Code Monkey home page Code Monkey logo

Comments (14)

julimueller avatar julimueller commented on June 29, 2024 1

Looks like the images are not correctly loaded because of an errorneous image path.

I think your argument --data_base_dir /Berlin/ is wrong. You should give the root directory where the data is stored, so if your Berlin folder is at /scratch/DTLD/Berlin.. you should call "--data_base_dir /scratch/DTLD/" because this is the entire dataset root dir.

Optional: Leave --data_base_dir empty and set all image paths in Berlin_all.yml to an absolute path, then it should also work.

from dtld_parsing.

poormag avatar poormag commented on June 29, 2024

Looks like the images are not correctly loaded because of an errorneous image path.

I think your argument --data_base_dir /Berlin/ is wrong. You should give the root directory where the data is stored, so if your Berlin folder is at /scratch/DTLD/Berlin.. you should call "--data_base_dir /scratch/DTLD/" because this is the entire dataset root dir.

Optional: Leave --data_base_dir empty and set all image paths in Berlin_all.yml to an absolute path, then it should also work.

No, it's okay with path cuz, i have removed some ugly part of path for question. And as you can see some of images can be read, am I right?

from dtld_parsing.

julimueller avatar julimueller commented on June 29, 2024

I cannot see that anything was loaded. What do you mean with "ugly part"? You have two options - either replace the paths by absolute paths or properly set the data_base_dir parameter.

from dtld_parsing.

julimueller avatar julimueller commented on June 29, 2024

Please add

scale = 1.0 / 16.0
print(self.disp_file_path)
img = cv2.imread(self.disp_file_path, cv2.IMREAD_UNCHANGED)
img[img == 65535] = 0

execute python3 setup.py install again, run

python3 load_dtld.py ...

again and tell me the output of print(self.disp_file_path)

from dtld_parsing.

poormag avatar poormag commented on June 29, 2024

I cannot see that anything was loaded. What do you mean with "ugly part"? You have two options - either replace the paths by absolute paths or properly set the data_base_dir parameter.

I mean my name, name of project, my granny's name and etc.I wrote a full path I mean like you said.

Please add

scale = 1.0 / 16.0
print(self.disp_file_path)
img = cv2.imread(self.disp_file_path, cv2.IMREAD_UNCHANGED)
img[img == 65535] = 0

execute python3 setup.py install again, run

python3 load_dtld.py ...

again and tell me the output of print(self.disp_file_path)

OK

from dtld_parsing.

poormag avatar poormag commented on June 29, 2024

It prints this "/Mary/traffic_lights/DTLD/Berlin//Berlin/Berlin1/2015-04-17_10-50-05/DE_BBBR667_2015-04-17_10-50-13-633939_nativeV2.tiff"

from dtld_parsing.

poormag avatar poormag commented on June 29, 2024

I have also removed '+/' and got a normal path without double slash (/Mary/traffic_lights/DTLD/Berlin/Berlin1/2015-04-17_10-50-05/DE_BBBR667_2015-04-17_10-50-13-633939_nativeV2.tiff) but it doesnt help

from dtld_parsing.

julimueller avatar julimueller commented on June 29, 2024

The double slash does not have any impact.

And this file really exists? What does "ls Mary/traffic_lights/DTLD/Berlin/Berlin1/2015-04-17_10-50-05/DE_BBBR667_2015-04-17_10-50-13-633939_nativeV2.tiff" in a terminal output?

from dtld_parsing.

julimueller avatar julimueller commented on June 29, 2024

BTW: Your first answer has /Mary/traffic_lights/DTLD/Berlin//Berlin/Berlin1/2015-04-17_10-50-05/DE_BBBR667_2015-04-17_10-50-13-633939_nativeV2.tiff.

I said you should NOT use --data_base_dir Berlin. It will not work, as you can see Berlin is now appearing two times .

from dtld_parsing.

poormag avatar poormag commented on June 29, 2024

the problem is: i can take this path and put it in cv2, then got an array of pixels.

cv2.imread('/Mary/traffic_lights/DTLD/Berlin/Berlin1/2015-04-17_10-50-05/DE_BBBR667_2015-04-17_10-50-13-633939_nativeV2.tiff')
Out[6]: 
array([[[255, 255, 255],
        [112, 112, 112],
        [ 80,  80,  80],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[176, 176, 176],
        [176, 176, 176],
        [128, 128, 128],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[176, 176, 176],
        [176, 176, 176],
        [128, 128, 128],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       ...,

       [[ 96,  96,  96],
        [ 96,  96,  96],
        [ 48,  48,  48],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[ 96,  96,  96],
        [ 96,  96,  96],
        [ 16,  16,  16],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]],

       [[255, 255, 255],
        [ 16,  16,  16],
        [ 16,  16,  16],
        ...,
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255]]], dtype=uint8)

But when im running script i have an error with this path and i have no idea why.

2020-04-23 16:30:30.568 INFO load_dtld - main: Distortion Matrix:

[[-0.036004  0.        0.        0.        0.      ]]

/Mary/traffic_lights/DTLD/Berlin/Berlin1/2015-04-17_10-50-05/DE_BBBR667_2015-04-17_10-50-13-633939_nativeV2.tiff
Traceback (most recent call last):
  File "load_dtld.py", line 106, in <module>
    main(parse_args())
  File "load_dtld.py", line 76, in main
    img_disp = img.visualize_disparity_image()
  File "/Mary/traffic_lights/dtld_parsing-master/python/dtld_parsing/driveu_dataset.py", line 207, in visualize_disparity_image
    img = self.get_disparity_image()
  File "/Mary/traffic_lights/dtld_parsing-master/python/dtld_parsing/driveu_dataset.py", line 190, in get_disparity_image
    img[img == 65535] = 0
TypeError: 'NoneType' object does not support item assignment

Anyway, i will not disturb you anymore (i see you dont know) if I will find the mistake i will put an answer here.

from dtld_parsing.

poormag avatar poormag commented on June 29, 2024

I don’t know how it worked for you guys, but my version of cv2 does not allow reading tiff files in a stream. As I thought there is no error in the path, using skiimage.io.imread instead of cv2.imread solved the problem of reading tiff files in the stream, but additional transformations are required to correctly display

from dtld_parsing.

julimueller avatar julimueller commented on June 29, 2024

Glad to hear, however you are the first one reporting such an issue. I use cv imread for reading 16 bit tiffs for many years without any issues. Nobdy else reported that issue and we have a lof of active users of the dataset.

Have fun using the data!

from dtld_parsing.

poormag avatar poormag commented on June 29, 2024

This is no less strange for me, I just tried using other libraries like PIL and skimage and it worked, but there are similar problems with StackoverFlow. So the first, but maybe not the last. Thank you for your work.

from dtld_parsing.

poormag avatar poormag commented on June 29, 2024

Ok, i did a little research about this problem and figure out that I'm using cv2 openvino build and this one doesn't work with tiff-files, now I have changed the environment and everything is okay too.

from dtld_parsing.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.