File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change 5
5
os .environ ["ROBOFLOW_CONFIG_DIR" ] = f"{ thisdir } /data/.config"
6
6
7
7
from roboflow .roboflowpy import _argparser # noqa: E402
8
+ from roboflow import Roboflow
8
9
9
10
# import requests
10
11
# requests.urllib3.disable_warnings()
11
12
12
13
rootdir = os .path .abspath (f"{ thisdir } /../.." )
13
14
sys .path .append (rootdir )
14
15
15
- if __name__ == "__main__" :
16
+
17
+ def run_cli ():
16
18
parser = _argparser ()
17
19
# args = parser.parse_args(["login"])
18
20
# args = parser.parse_args(f"upload {thisdir}/../datasets/chess -w wolfodorpythontests -p chess".split()) # noqa: E501 // docs
45
47
# f"import -w tonyprivate -p meh-plvrv {thisdir}/../datasets/paligemma/".split() # noqa: E501 // docs
46
48
)
47
49
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 ()
You can’t perform that action at this time.
0 commit comments