Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

randomroate by some change #3030

Open
SlowMonk opened this issue Nov 19, 2020 · 0 comments
Open

randomroate by some change #3030

SlowMonk opened this issue Nov 19, 2020 · 0 comments

Comments

@SlowMonk
Copy link

SlowMonk commented Nov 19, 2020

def mapper(dataset_dict):
    dataset_dict = copy.deepcopy(dataset_dict)  # it will be modified by code below
    image = utils.read_image(dataset_dict["file_name"], format="BGR")    
    transform_list = [
                  
                     T.ResizeShortestEdge(short_edge_length=(640, 672, 704, 736, 768, 800), max_size=1333, sample_style='choice')
                     ,T.RandomRotation([10,15])
                
                      ]
    image, transforms = T.apply_transform_gens(transform_list, image)
    dataset_dict["image"] = torch.as_tensor(image.transpose(2, 0, 1).astype("float32"))

    
    #print('image_shape->',image.shape,image.shape[:2])

    annos = [
        utils.transform_instance_annotations(obj, transforms, image.shape[:2])
        for obj in dataset_dict.pop("annotations")
        if obj.get("iscrowd", 0) == 0
    ]

    instances = utils.annotations_to_instances(annos, image.shape[:2])
    dataset_dict["instances"] = instances
    #dataset_dict["instances"] = utils.filter_empty_instances(instances)
    return dataset_dict

this is my mapper for augmentation.
is T.RandomRotation([10,15]) happen every image? or by some change.
if it apply to every images. how should I apply it by only some percentage?

cc @vfdev-5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants