Skip to content

Commit 6962c31

Browse files
bowiechenmeta-codesync[bot]
authored andcommitted
apply Black 25.11.0 style in fbcode (73/92)
Summary: Formats the covered files with pyfmt. paintitblack Reviewed By: itamaro Differential Revision: D90476332 fbshipit-source-id: 5d374665e0f665030f4491998aa2c6ed78d19e3e
1 parent b4669a2 commit 6962c31

22 files changed

Lines changed: 40 additions & 49 deletions

annotation_gui_gcp/lib/GUI.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def create_ui(self, cad_paths):
7373
v = ImageView(
7474
self,
7575
self.app,
76-
f"/sequence_view_{ix+1}",
76+
f"/sequence_view_{ix + 1}",
7777
image_keys,
7878
has_views_that_need_tracking,
7979
)
@@ -84,7 +84,7 @@ def create_ui(self, cad_paths):
8484

8585
self.cad_views = []
8686
for ix, cad_path in enumerate(cad_paths):
87-
v = CADView(self, self.app, f"/cad_view_{ix+1}", cad_path)
87+
v = CADView(self, self.app, f"/cad_view_{ix + 1}", cad_path)
8888
self.cad_views.append(v)
8989

9090
subpane_routes = [

annotation_gui_gcp/lib/gcp_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ def add_point_observation(
218218
assert self.get_observation(point_id, shot_id) is None
219219
if geo:
220220
mtime = geo["measured_at"]
221-
assert isinstance(
222-
mtime, int
223-
), "Measurement time should be integer (unix time)"
221+
assert isinstance(mtime, int), (
222+
"Measurement time should be integer (unix time)"
223+
)
224224
point.geodetic_measurement = GeodeticMeasurement(
225225
longitude=geo["longitude"],
226226
latitude=geo["latitude"],

annotation_gui_gcp/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ def file_sanity_check(root, seq_dict, fname) -> t.Set[str]:
6868

6969
n_missing = len(keys_in_seq_dict - available_images)
7070
if n_missing > 0:
71-
print(f"There are {n_missing} images from {fname} missing in {(root/'images')}")
71+
print(
72+
f"There are {n_missing} images from {fname} missing in {(root / 'images')}"
73+
)
7274

7375
return available_images
7476

annotation_gui_gcp/run_ba.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def add_gcp_to_bundle(
248248
coordinates = np.array(enu)
249249
else:
250250
logger.warning(
251-
"Cannot initialize GCP '{}'." " Ignoring it".format(point.id)
251+
"Cannot initialize GCP '{}'. Ignoring it".format(point.id)
252252
)
253253
continue
254254

@@ -751,7 +751,7 @@ def align(
751751
data.config["triangulation_min_ray_angle"] = backup
752752
logger.info(
753753
f"Re-triangulated. Removed {n_points - len(merged.points)}."
754-
f" Kept {int(100*len(merged.points)/n_points)}%"
754+
f" Kept {int(100 * len(merged.points) / n_points)}%"
755755
)
756756
data.save_reconstruction(
757757
[merged],
@@ -878,7 +878,7 @@ def align(
878878
for ix, gcp_id in enumerate(gcps_sorted[:5]):
879879
n = stats_bad_reprojections[gcp_id]
880880
if n > 0:
881-
logger.info(f"#{ix+1} - {gcp_id}: {n} bad annotations")
881+
logger.info(f"#{ix + 1} - {gcp_id}: {n} bad annotations")
882882
else:
883883
logger.info("No annotations with large reprojection errors")
884884

bin/plot_gcp.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
from typing import List
66

77
import matplotlib.pyplot as plt
8-
98
import numpy as np
10-
119
import opensfm.reconstruction as orec
1210
from opensfm import dataset, features, io, pymap, types
1311

opensfm/actions/export_openmvs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# pyre-strict
22
import os
3-
43
from typing import Dict, Optional
54

65
import numpy as np

opensfm/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def load_mask(self, image: str) -> Optional[NDArray]:
128128
mask = self.io_handler.imread(mask_path, grayscale=True)
129129
if mask is None:
130130
raise IOError(
131-
"Unable to load mask for image {} " "from file {}".format(
131+
"Unable to load mask for image {} from file {}".format(
132132
image, mask_path
133133
)
134134
)

opensfm/exif.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import numpy as np
1010
import xmltodict as x2d
1111
from opensfm import pygeometry
12-
1312
from opensfm.dataset_base import DataSetBase
1413
from opensfm.geo import ecef_from_lla
1514
from opensfm.sensors import camera_calibration, sensor_data

opensfm/feature_loading.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from typing import Optional, Tuple
55

66
import cv2
7-
87
import numpy as np
98
from numpy.typing import NDArray
109
from opensfm import features as ft, masking, pygeometry

opensfm/features.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ def build_flann_index(descriptors: NDArray, config: Dict[str, Any]) -> cv2.flann
648648
elif algorithm_type == "KDTREE":
649649
FLANN_INDEX_METHOD = FLANN_INDEX_KDTREE
650650
else:
651-
raise ValueError("Unknown flann algorithm type " "must be KMEANS, KDTREE")
651+
raise ValueError("Unknown flann algorithm type must be KMEANS, KDTREE")
652652
flann_params = {
653653
"algorithm": FLANN_INDEX_METHOD,
654654
"branching": config["flann_branching"],

0 commit comments

Comments
 (0)