Skip to content

Commit c98abbd

Browse files
fix(pre_commit): 🎨 auto format pre-commit hooks
1 parent 401a8b3 commit c98abbd

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

roboflow/models/inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def predict_video(
169169
url = urljoin(API_URL, "/video_upload_signed_url?api_key=" + self.__api_key)
170170
if fps > 120:
171171
raise Exception("FPS must be less than or equal to 120.")
172-
172+
173173
for model in additional_models:
174174
if model not in SUPPORTED_ADDITIONAL_MODELS:
175175
raise Exception(f"Model {model} is not supported for video inference.")

roboflow/roboflowpy.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from roboflow.models.object_detection import ObjectDetectionModel
1414
from roboflow.models.semantic_segmentation import SemanticSegmentationModel
1515

16+
1617
def login(args):
1718
roboflow.login()
1819

@@ -110,25 +111,26 @@ def get_workspace(args):
110111
api_key = load_roboflow_api_key(args.workspaceId)
111112
workspace_json = rfapi.get_workspace(api_key, args.workspaceId)
112113
print(json.dumps(workspace_json, indent=2))
113-
114+
114115

115116
def run_video_inference_api(args):
116117
rf = roboflow.Roboflow(args.api_key)
117118
project = rf.workspace().project(args.project)
118119
version = project.version(args.version_number)
119120
model = project.version(version).model
120121

121-
#model = VideoInferenceModel(args.api_key, project.id, version.version, project.id) # Pass dataset_id
122-
# Pass model_id and version
122+
# model = VideoInferenceModel(args.api_key, project.id, version.version, project.id) # Pass dataset_id
123+
# Pass model_id and version
123124
job_id, signed_url, expire_time = model.predict_video(
124-
args.video_file,
125-
fps=40,
126-
prediction_type="batch-video",
125+
args.video_file,
126+
fps=40,
127+
prediction_type="batch-video",
127128
)
128129
results = model.poll_until_video_results(job_id)
129130
with open("test_video.json", "w") as f:
130131
json.dump(results, f)
131132

133+
132134
def get_workspace_project_version(args):
133135
# api_key = load_roboflow_api_key(args.workspaceId)
134136
rf = roboflow.Roboflow(args.api_key)
@@ -346,12 +348,13 @@ def _add_workspaces_parser(subparsers):
346348
)
347349
workspaceget_parser.set_defaults(func=get_workspace)
348350

351+
349352
def _add_run_video_inference_api_parser(subparsers):
350353
run_video_inference_api_parser = subparsers.add_parser(
351354
"run_video_inference_api",
352355
help="run video inference api",
353356
)
354-
357+
355358
run_video_inference_api_parser.add_argument(
356359
"-a",
357360
dest="api_key",
@@ -375,6 +378,7 @@ def _add_run_video_inference_api_parser(subparsers):
375378
)
376379
run_video_inference_api_parser.set_defaults(func=run_video_inference_api)
377380

381+
378382
def _add_infer_parser(subparsers):
379383
infer_parser = subparsers.add_parser(
380384
"infer",

0 commit comments

Comments
 (0)