Giter Club home page Giter Club logo

Comments (2)

JamesCallanan avatar JamesCallanan commented on May 25, 2024

I found the issue. It is due to the resizing of the cam variable using skimage.transform.resize().

from skimage.transform import resize
capi=resize(cam,(128,128,128))

This resizing implementation results in cam[ : , : , 0 ] equalling cam[ : , : , 1 ] and cam[ : , : , -1 ] equalling cam[ : , : , -2] for me.

Swapping the resizing function which relies on scipy.ndimage.zoom()) worked for me.
Now each slice now is unique.

def resize_volume(img, desired_depth, desired_height, desired_width):
"""Resize across z-axis"""
# Get current depth
current_depth = img.shape[-1]
current_width = img.shape[0]
current_height = img.shape[1]
# Compute depth factor
depth = current_depth / desired_depth
width = current_width / desired_width
height = current_height / desired_height
depth_factor = 1 / depth
width_factor = 1 / width
height_factor = 1 / height
# Rotate
img = ndimage.rotate(img, 90, reshape=False)
# Resize across z-axis
img = ndimage.zoom(img, (width_factor, height_factor, depth_factor), order=1)
return img

capi = resize_volume(cam,128,128,128)

from 3d-grad-cam.

sneh-debug avatar sneh-debug commented on May 25, 2024

hello @JamesCallanan @fitushar please let me know how much memory is required for it? as I am getting OOM memory exhaustion error. I have 24GB GPUs and 128GB RAM

from 3d-grad-cam.

Related Issues (4)

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.