Skip to content

Commit de5b9ca

Browse files
author
shuichi
committed
refactor
1 parent 04ea578 commit de5b9ca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/to_visual_inspection_ai.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66

77
class VisualInspectionAiConverter:
8-
def convert_from_bbox(
8+
def convert_from_json(
99
self, file_path: str, export_file_path: str, project_type: str
1010
) -> dict:
11-
json = self.open_bbox(file_path)
11+
json = self.open_file(file_path)
1212
if project_type == "bbox":
1313
visual_inspection_ai = VisualInspectionAi.from_bbox(json)
1414
else:
@@ -18,7 +18,7 @@ def convert_from_bbox(
1818
with open(export_file_path, "w") as file:
1919
file.write(visual_inspection_ai.as_jsonl())
2020

21-
def open_bbox(self, file_path: str) -> any:
21+
def open_file(self, file_path: str) -> any:
2222
return json.load(open(file_path, "r"))
2323

2424

@@ -38,4 +38,4 @@ def open_bbox(self, file_path: str) -> any:
3838
file_path = "./import/visual_inspection_ai/segmentation/annotations.json" # 入力元のファイルパスを指定
3939
project_type = "segmentation"
4040

41-
result = converter.convert_from_bbox(file_path, export_file_path, project_type)
41+
result = converter.convert_from_json(file_path, export_file_path, project_type)

0 commit comments

Comments
 (0)