Skip to content

Commit 92bd1b9

Browse files
authored
Merge pull request #400 from roboflow/tony/debug-train-api
Add function to debug train api
2 parents bd2ee61 + 4d185a5 commit 92bd1b9

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

tests/manual/debugme.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
os.environ["ROBOFLOW_CONFIG_DIR"] = f"{thisdir}/data/.config"
66

77
from roboflow.roboflowpy import _argparser # noqa: E402
8+
from roboflow import Roboflow
89

910
# import requests
1011
# requests.urllib3.disable_warnings()
1112

1213
rootdir = os.path.abspath(f"{thisdir}/../..")
1314
sys.path.append(rootdir)
1415

15-
if __name__ == "__main__":
16+
17+
def run_cli():
1618
parser = _argparser()
1719
# args = parser.parse_args(["login"])
1820
# args = parser.parse_args(f"upload {thisdir}/../datasets/chess -w wolfodorpythontests -p chess".split()) # noqa: E501 // docs
@@ -45,3 +47,32 @@
4547
# f"import -w tonyprivate -p meh-plvrv {thisdir}/../datasets/paligemma/".split() # noqa: E501 // docs
4648
)
4749
args.func(args)
50+
51+
52+
def run_api_train():
53+
rf = Roboflow()
54+
project = rf.workspace("meh3").project("mosquitobao")
55+
# version_number = project.generate_version(
56+
# settings={
57+
# "augmentation": {
58+
# "bbblur": {"pixels": 1.5},
59+
# "image": {"versions": 2},
60+
# },
61+
# "preprocessing": {
62+
# "auto-orient": True,
63+
# },
64+
# }
65+
# )
66+
version_number = "61"
67+
print(version_number)
68+
version = project.version(version_number)
69+
model = version.train(
70+
speed="fast", # Options: "fast" (default) or "accurate" (paid feature)
71+
checkpoint=None, # Use a specific checkpoint to continue training
72+
)
73+
print(model)
74+
75+
76+
if __name__ == "__main__":
77+
# run_cli()
78+
run_api_train()

0 commit comments

Comments
 (0)