GithubHelp home page GithubHelp logo

Comments (2)

jiwei0921 avatar jiwei0921 commented on May 20, 2024

Thank you for your interests very much. I really missed your point. Before, what I did was I normalized all the input images. There is no problem with that, so ignore your problem. You can directly use this link(https://github.com/jiwei0921/RGBD-SOD-datasets) to download and test images, which is available. I will pay attention to the problems you mentioned and update them in time.
Thanks again.

from dmra.

Jrokisky avatar Jrokisky commented on May 20, 2024

Hi @jiwei0921 I think I ran into a similar issue as @zhoufengbuaa .

Versions:
Pytorch==1.1
Pillow==5.4.0

When trying to load the files: 1342_ro90 & 1323_flr in the data_loaders __getitem__ method I get the error:

int() argument must be a string, a bytes-like object or a number, not 'PngImageFile'

When depth = np.array(depth, dtype=np.uint8) is called.

I'm going to test removing those files from the provided training dataset and see if that fixes the issue. Will report back if that fixes the issue.

Here's the code I used to find the files w/ issues:

import PIL.Image
import numpy as np
import os

base = REPLACE_WITH_DIRECTORY_ROOT
img_root = os.path.join(base, 'train_images')
lbl_root = os.path.join(base, 'train_masks')
depth_root = os.path.join(base, 'train_depth')

file_names = os.listdir(img_root)
for i, name in enumerate(file_names):
    if not name.endswith('.jpg'):
        continue
    lbl = os.path.join(lbl_root, name[:-4]+'.png')
    img = os.path.join(img_root, name)
    dep = os.path.join(depth_root, name[:-4]+'.png')
    try:
        imgL = PIL.Image.open(lbl)
        np.array(imgL, dtype=np.int32)
        imgI = PIL.Image.open(img)
        np.array(imgI, dtype=np.uint8)
        imgD = PIL.Image.open(dep)
        np.array(imgD, dtype=np.uint8)
    except Exception as e:
        print(e)
        print(name +" => " + str(i) + "\n")

from dmra.

Related Issues (9)

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.