Code Monkey home page Code Monkey logo

Comments (3)

acl21 avatar acl21 commented on May 30, 2024

Can you elaborate more with an example?

from image_bbox_slicer.

ccimarp1990 avatar ccimarp1990 commented on May 30, 2024

For example,
my original image called "image1", "image2","image3",.... I would like to add to each tile image the original name plus a sequencial number.
image1_1; image1_2;.....

from image_bbox_slicer.

acl21 avatar acl21 commented on May 30, 2024

For images, you'd have to change the for loop at line 234 in image_bbox_slicer/main.py to something like this:

for tile_id, tile in enumerate(tiles):
    new_im = im.crop(tile)
    img_id_str = str('{}_{}'.format(file_name, tile_id+1))
    if len(self._ignore_tiles) != 0:
        if img_id_str in self._ignore_tiles:
            self._ignore_tiles.remove(img_id_str)
            continue
    new_im.save(
        '{}/{}.{}'.format(self.IMG_DST, img_id_str, file_type))
    new_ids.append(img_id_str)
    img_no += 1

I did not test this code, I just wrote it out by copy-pasting from the source just so you get the idea. Make sure to do similar changes wherever I am initializing the image id string e.g., line 316 where sliced annotations can be renamed.

from image_bbox_slicer.

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.