Skip to content

Split your jpg and xml files into train and test folders

Notifications You must be signed in to change notification settings

kaviles22/Image-and-XML-splitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

Image-and-XML-splitter

Split your jpg and xml files into train and test folders

This script will split the images that contain also an xml file with the same name. Example:

  • image1.jpg
  • image1.xml
  • image2.jpg
  • image2.xml
  • ...

Source folder

The folder containing the images should be organized this way:

  • Collected images
    • class1
      • image1.jpg
      • image1.xml
      • image2.jpg
      • image2.xml
      • ...
    • class2
      • image1.jpg
      • image1.xml
      • image2.jpg
      • image2.xml
      • ...
    • class3
      • image1.jpg
      • image1.xml
      • image2.jpg
      • image2.xml
      • ...

Destination folder

The destination folder will have the following structure

  • Splitted images
    • train
    • test

The file should be placed on the main path, initially it should look like this:

  • Main path
    • Collected images
    • split_images_xml.py

Final directory

After running th file the directory will look like this:

  • Main path
    • Collected images
    • Splitted images
      • train
      • test
    • split_images_xml.py

Command line

python split_images_xml.py --image_folder= (The path where all the images are stored) --train_percentage= (PERCENTAGE OF DATASET FOR TRAINING)

About

Split your jpg and xml files into train and test folders

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages