Skip to content

How to keep original file names  #17

@qqaadir

Description

@qqaadir

Dear @lozuwa

This is a great work. I have created new reduced images and annotations successfully. I am wondering is there a way to keep original files name instead of assigning new names. I have the following code

def main():
    images_path = os.path.join(os.getcwd(), "images")
    annotations_path = os.path.join(os.getcwd(), "Annotation")
    # Define the name of the dataset
    dbName = "CarsDataset"
	# Create an object of ObjectDetectionDataset
    obda = ObjectDetectionDataset(imagesDirectory=images_path, annotationsDirectory=annotations_path, databaseName = dbName)
	# Reduce the dataset to smaller Rois of smaller ROIs of shape 1092 x 1080.
    offset=[480, 360]
    images_output_path = os.path.join(os.getcwd(), "images_reduced")
    annotations_output_path = os.path.join(os.getcwd(), "Annotation_reduced")
    obda.reduceDatasetByRois(offset = offset, outputImageDirectory = images_output_path, outputAnnotationDirectory = annotations_output_path)

if __name__ == "__main__":
	main()

this code append CarsDataset at the start of each image and it assigns some ids to each image. What I want is to keep original image names, for example if my file name is image_1 and your library create four crops, I want to name those crops as image_1_1, .... images_1_4. Thank you for your suggestions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions