Code Monkey home page Code Monkey logo

acl21 / image_bbox_slicer Goto Github PK

View Code? Open in Web Editor NEW
74.0 4.0 28.0 12.7 MB

This easy-to-use library is a data transformer sometimes useful in Object Detection and Segmentation tasks. With only a few lines of code, one can slice images and their bounding box annotations into smaller tiles, both into specific sizes and into any arbitrary number of equal parts. The tool also supports resizing of images and their bounding box annotations, both by specific sizes and by a resizing/scaling factor.

Home Page: https://image-bbox-slicer.readthedocs.io/en/latest/

License: MIT License

Jupyter Notebook 98.42% Python 1.58%
image-slicer bounding-box-slicer pascal-voc image-bounding-box-slicer object-detection image-resizer bounding-box-resizer segmentation

image_bbox_slicer's People

Contributors

acl21 avatar atagulmert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

image_bbox_slicer's Issues

Filename exception although file names and paths are the same or correct - windows issue

I am trying to use the image_bbox_slicer in that it fits exactly my use case. My problem is that it keeps through exceptions like below no matter what filenames or paths I used. I looked at your code a little bit thinking that maybe it is my file names which are like "Scenario_10_3_1_standing_by_vehicle_150ft-0058.jpg". I did not see anything in your code that would have a problem with the file name. Do you have any suggestions on what I am doing wrong?

Exception: Each image in E:/sd_data_collection/sd_11_15_19/ripped_frames/tile_test/test_src/images must have its corresponding XML file in E:/sd_data_collection/sd_11_15_19/ripped_frames/tile_test/test_src/annotations with the same file name.

xml annotation has initial sourcefile rather than tile filename, which causes problems when converting to TF records

Hi,

This is a fab tool but unfortunately, it places the source filename in the XML not the tile filename

<filename>**ORIGINAL_FILENAME_WITHOUT_FILETYPE**</filename>
<path>**ORIGINAL_FILEPATH_WITHOUT_FILETYPE**</path>
<source>

When using the scripts from the Tensorflow object detection API tutorial, this causes creation of TF records to fail as it looks for files, which arent there
https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html#preparing-the-dataset

I will work on a PR to address it but wanted to raise this as an issue

How to combine the sliced image?

After passing through the object detection model how to get the original image back with predicted coordinated for each object?

Merge sliced annotations

Hi!
First of all i just want to say what a great tool this is!

I'm wondering if there is any possibility to merge sliced annotations back to it's original image?

Let's say i slice an image, train a model for object detection, predict on a new image sliced as the training data. I would then want to merge the predicted bounding boxes with the non-sliced image.

Any idea how i would go about?

Cheers!

Tile size cannot exceed image size

Hi,

I am getting the above error due to the image size being (0,0). I have a JPEG image in the src/image folder but for some reason the image slicer is not reading it properly. How do I get the slicer to properly read this?

Thanks!

Same name + index

I would to have the original name of the image/annotation following a index to distinguish different files. How can I change the code?

validate_file_names not working properly when filenames include '.'

Hey, validate_file_names function does not work properly and splits the filename multiple times when there are multiple chars of '.' in the filename other than extension's. This can be solved by replacing split method with os.splitext on those two lines:

+imgs = [os.path.splitext(x.split(separator)[-1])[0] for x in imgs]
+anns = [os.path.splitext(x.split(separator)[-1])[0] for x in anns]
-imgs = [x.split(separator)[-1].split('.')[-2] for x in imgs]
-anns = [x.split(separator)[-1].split('.')[-2] for x in anns]

For example filename = mert1.atagul2.png generated img name = atagul2

slicer bbox annotations

I have used the tool to slice my image and its bbox annotations(keep partial labels and ignore empty tiles). Some bboxes coordinates are -1, and I wonder what made this outcomes.

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.