Skip to content

Commit 7684ebc

Browse files
generatedunixname89002005232357meta-codesync[bot]
authored andcommitted
Revert D107142434: Enable Pyrefly in fbcode/vision/fair
Differential Revision: D107142434 Original commit changeset: 25929bb3d5a3 Original Phabricator Diff: D107142434 fbshipit-source-id: 0aecaeba28d7d8db8f9273406a080e41aa77c4a7
1 parent e1d69fe commit 7684ebc

27 files changed

Lines changed: 0 additions & 60 deletions

projects/DensePose/densepose/converters/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def _lookup_converter(cls, from_type: Type) -> Any:
5454
if no suitable entry was found in the registry
5555
"""
5656
if from_type in cls.registry: # pyre-ignore[16]
57-
# pyrefly: ignore [missing-attribute]
5857
return cls.registry[from_type]
5958
for base in from_type.__bases__:
6059
converter = cls._lookup_converter(base)

projects/DensePose/densepose/converters/chart_output_to_chart_result.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def densepose_chart_predictor_output_to_result(
9393

9494
boxes_xyxy_abs = boxes.tensor.clone()
9595
boxes_xywh_abs = BoxMode.convert(boxes_xyxy_abs, BoxMode.XYXY_ABS, BoxMode.XYWH_ABS)
96-
# pyrefly: ignore [bad-argument-type]
9796
box_xywh = make_int_box(boxes_xywh_abs[0])
9897

9998
labels = resample_fine_and_coarse_segm_to_bbox(predictor_output, box_xywh).squeeze(0)
@@ -184,7 +183,6 @@ def densepose_chart_predictor_output_to_result_with_confidences(
184183

185184
boxes_xyxy_abs = boxes.tensor.clone()
186185
boxes_xywh_abs = BoxMode.convert(boxes_xyxy_abs, BoxMode.XYXY_ABS, BoxMode.XYWH_ABS)
187-
# pyrefly: ignore [bad-argument-type]
188186
box_xywh = make_int_box(boxes_xywh_abs[0])
189187

190188
labels = resample_fine_and_coarse_segm_to_bbox(predictor_output, box_xywh).squeeze(0)

projects/DensePose/densepose/converters/segm_to_mask.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ def predictor_output_with_coarse_segm_to_mask(
109109
N = len(boxes_xywh_abs)
110110
masks = torch.zeros((N, H, W), dtype=torch.bool, device=boxes.tensor.device)
111111
for i in range(len(boxes_xywh_abs)):
112-
# pyrefly: ignore [bad-argument-type]
113112
box_xywh = make_int_box(boxes_xywh_abs[i])
114113
box_mask = resample_coarse_segm_tensor_to_bbox(predictor_output[i].coarse_segm, box_xywh)
115114
x, y, w, h = box_xywh
@@ -146,7 +145,6 @@ def predictor_output_with_fine_and_coarse_segm_to_mask(
146145
N = len(boxes_xywh_abs)
147146
masks = torch.zeros((N, H, W), dtype=torch.bool, device=boxes.tensor.device)
148147
for i in range(len(boxes_xywh_abs)):
149-
# pyrefly: ignore [bad-argument-type]
150148
box_xywh = make_int_box(boxes_xywh_abs[i])
151149
labels_i = resample_fine_and_coarse_segm_to_bbox(predictor_output[i], box_xywh)
152150
x, y, w, h = box_xywh

projects/DensePose/densepose/data/build.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ def _maybe_create_specific_keep_instance_predicate(cfg: CfgNode) -> Optional[Ins
225225
return None
226226

227227
def combined_predicate(instance: Instance) -> bool:
228-
# pyrefly: ignore [not-callable]
229228
return any(p(instance) for p in predicates)
230229

231230
return combined_predicate
@@ -236,7 +235,6 @@ def _get_train_keep_instance_predicate(cfg: CfgNode):
236235
combined_specific_keep_predicate = _maybe_create_specific_keep_instance_predicate(cfg)
237236

238237
def combined_general_specific_keep_predicate(instance: Instance) -> bool:
239-
# pyrefly: ignore [not-callable]
240238
return general_keep_predicate(instance) and combined_specific_keep_predicate(instance)
241239

242240
if (general_keep_predicate is None) and (combined_specific_keep_predicate is None):
@@ -388,9 +386,7 @@ def combine_detection_dataset_dicts(
388386
"""
389387
assert len(dataset_names)
390388
if proposal_files is None:
391-
# pyrefly: ignore [bad-assignment]
392389
proposal_files = [None] * len(dataset_names)
393-
# pyrefly: ignore [bad-argument-type]
394390
assert len(dataset_names) == len(proposal_files)
395391
# load datasets and metadata
396392
dataset_name_to_dicts = {}
@@ -407,7 +403,6 @@ def combine_detection_dataset_dicts(
407403
# map to contiguous category IDs
408404
_add_category_id_to_contiguous_id_maps_to_metadata(merged_categories)
409405
# load annotations and dataset metadata
410-
# pyrefly: ignore [bad-argument-type]
411406
for dataset_name, proposal_file in zip(dataset_names, proposal_files):
412407
dataset_dicts = dataset_name_to_dicts[dataset_name]
413408
assert len(dataset_dicts), f"Dataset '{dataset_name}' is empty!"
@@ -552,7 +547,6 @@ def build_bootstrap_dataset(dataset_name: str, cfg: CfgNode) -> Sequence[torch.T
552547
dataset = factory(meta, cfg)
553548
if dataset is None:
554549
logger.warning(f"Failed to create dataset {dataset_name} of type {meta.dataset_type}")
555-
# pyrefly: ignore [bad-return]
556550
return dataset
557551

558552

@@ -741,5 +735,4 @@ def register(self, dataset_type: DatasetType, factory: Callable[[Metadata, CfgNo
741735

742736

743737
BootstrapDatasetFactoryCatalog = _BootstrapDatasetFactoryCatalog()
744-
# pyrefly: ignore [bad-argument-type]
745738
BootstrapDatasetFactoryCatalog.register(DatasetType.VIDEO_LIST, build_video_list_dataset)

projects/DensePose/densepose/data/dataset_mapper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ def _add_densepose_masks_as_segmentation(
157157
bbox_segm_dp = torch.tensor((0, 0, segm_h - 1, segm_w - 1), dtype=torch.float32)
158158
# image bbox
159159
x0, y0, x1, y1 = (
160-
# pyrefly: ignore [missing-attribute]
161160
v.item() for v in BoxMode.convert(obj["bbox"], obj["bbox_mode"], BoxMode.XYXY_ABS)
162161
)
163162
segm_aligned = (

projects/DensePose/densepose/data/datasets/coco.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ def _combine_images_with_annotations(
253253
record["dataset"] = dataset_name
254254
if "frame_id" in img_dict:
255255
record["frame_id"] = img_dict["frame_id"]
256-
# pyrefly: ignore [unsupported-operation]
257256
record["video_id"] = img_dict.get("vid_id", None)
258257
contains_video_frame_info = True
259258
objs = []
@@ -266,7 +265,6 @@ def _combine_images_with_annotations(
266265
_maybe_add_keypoints(obj, ann_dict)
267266
_maybe_add_densepose(obj, ann_dict)
268267
objs.append(obj)
269-
# pyrefly: ignore [unsupported-operation]
270268
record["annotations"] = objs
271269
dataset_dicts.append(record)
272270
if contains_video_frame_info:

projects/DensePose/densepose/data/image_list_dataset.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ def __init__(
3636
if type(category_list) is list:
3737
self.category_list = category_list
3838
else:
39-
# pyrefly: ignore [bad-assignment]
4039
self.category_list = [category_list] * len(image_list)
4140
assert len(image_list) == len(
4241
self.category_list
4342
), "length of image and category lists must be equal"
4443
self.image_list = image_list
4544
self.transform = transform
4645

47-
# pyrefly: ignore [bad-override-param-name]
4846
def __getitem__(self, idx: int) -> Dict[str, Any]:
4947
"""
5048
Gets selected images from the list

projects/DensePose/densepose/data/meshes/catalog.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def __init__(self, *args, **kwargs):
2626
self.mesh_names = {}
2727
self.max_mesh_id = -1
2828

29-
# pyrefly: ignore [bad-override-param-name]
3029
def __setitem__(self, key, value):
3130
if key in self:
3231
logger = logging.getLogger(__name__)

projects/DensePose/densepose/data/samplers/densepose_base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def __call__(self, instances: Instances) -> DensePoseList:
3939
boxes_xywh_abs = BoxMode.convert(boxes_xyxy_abs, BoxMode.XYXY_ABS, BoxMode.XYWH_ABS)
4040
dp_datas = []
4141
for i in range(len(boxes_xywh_abs)):
42-
# pyrefly: ignore [bad-argument-type]
4342
annotation_i = self._sample(instances[i], make_int_box(boxes_xywh_abs[i]))
4443
annotation_i[DensePoseDataRelative.S_KEY] = self._resample_mask( # pyre-ignore[6]
4544
instances[i].pred_densepose

projects/DensePose/densepose/data/samplers/densepose_cse_base.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def _sample(self, instance: Instances, bbox_xywh: IntTupleBox) -> Dict[str, List
7070

7171
count = min(self.count_per_class, k)
7272
if count <= 0:
73-
# pyrefly: ignore [bad-return]
7473
return annotation
7574

7675
index_sample = self._produce_index_sample(values, count)
@@ -86,13 +85,9 @@ def _sample(self, instance: Instances, bbox_xywh: IntTupleBox) -> Dict[str, List
8685
x = (sampled_x / w * 256.0).cpu().tolist()
8786
y = (sampled_y / h * 256.0).cpu().tolist()
8887
# extend annotations
89-
# pyrefly: ignore [missing-attribute]
9088
annotation[DensePoseDataRelative.X_KEY].extend(x)
91-
# pyrefly: ignore [missing-attribute]
9289
annotation[DensePoseDataRelative.Y_KEY].extend(y)
93-
# pyrefly: ignore [missing-attribute]
9490
annotation[DensePoseDataRelative.VERTEX_IDS_KEY].extend(closest_vertices.cpu().tolist())
95-
# pyrefly: ignore [bad-return]
9691
return annotation
9792

9893
def _produce_mask_and_results(

0 commit comments

Comments
 (0)