pytorch / pytorch/vision

randomroate by some change

Open
#3,030 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

module: transforms question
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the mapper shown in the issue and the documented behavior of T.RandomRotation. Check whether the transform is applied deterministically or probabilistically, and identify the documented way to configure a target application percentage; the issue names no repository file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.