Giter Site home page Giter Site logo

Comments (4)

ahundt avatar ahundt commented on July 22, 2024

I suggest a small test script that loads an image, call the function with obvious parameters like half the height and an eighth the width, write out the result, and post both the original and processed images here... and maybe include the test script too in a pull request haha since it will be needed later if this is to move into keras-contrib

from keras-fcn.

PavlosMelissinos avatar PavlosMelissinos commented on July 22, 2024

Here's the test script

from keras.preprocessing.image import img_to_array, array_to_img
from utils import SegDataGenerator
from PIL import Image as PILImage


def test_crop(crop_function):
    filename = 'data/1.jpg'

    img = PILImage.open(filename)

    crop_width = img.width / 5
    crop_height = img.height / 8

    print(crop_height, crop_width)

    img = img_to_array(img)

    result = crop_function(img, (crop_width, crop_height), 'channels_last')
    result = array_to_img(result)

    assert result.width == crop_width
    assert result.height == crop_height


test_crop(SegDataGenerator.center_crop)

test_crop(SegDataGenerator.random_crop)

and I've created a jupyter notebook to showcase. You can find it here

Do you think this is enough, so that I can add the test and the correct code in a pull request? Mentioning @aurora95 as well.

from keras-fcn.

ahundt avatar ahundt commented on July 22, 2024

Yeah I see what you're saying, my usage so far was square so I didn't come across that. Maybe put that code in a /test/ folder in the pull request with the fix and I'm sure it will be good to merge. :-)

from keras-fcn.

PavlosMelissinos avatar PavlosMelissinos commented on July 22, 2024

I have submitted a PR. Not so sure about the validity of the test though. Closing the issue for the time being.

from keras-fcn.

Related Issues (20)

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.