You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Load a certain project, workspace url is optional
54
+
# Load a certain project (workspace url is optional)
55
55
project = rf.project("PROJECT_ID")
56
56
57
57
# List all versions of a specific project
@@ -61,7 +61,7 @@ project.versions()
61
61
project.upload("UPLOAD_IMAGE.jpg")
62
62
63
63
# Retrieve the model of a specific project
64
-
project.version("1").model
64
+
model =project.version("1").model
65
65
66
66
# predict on a local image
67
67
prediction = model.predict("YOUR_IMAGE.jpg")
@@ -79,49 +79,109 @@ prediction.json()
79
79
prediction.save(output_path='predictions.jpg')
80
80
```
81
81
82
-
## Using this package for a specifc project
82
+
## Using this package for a specific project
83
83
84
-
If you have a specific project from your workspace you'd like to run in a notebook follow along on this tutorial [Downloading Datasets from Roboflow for Training (Python)](https://www.youtube.com/watch?v=76E6esnez8E)
84
+
If you have a specific project from your workspace you'd like to run in a notebook, follow along with this tutorial:[Downloading Datasets from Roboflow for Training (Python)](https://www.youtube.com/watch?v=76E6esnez8E).
85
85
86
86
Selecting the format you'd like your project to be exported as while choosing the `show download code` option will display code snippets you can use in either Jupyter or your terminal. These code snippets will include your `api_key`, project, and workspace names.
4. install packages from repo: `pip3 install -e ".[dev]"`
95
-
5. create script on top level of `ROBOFLOW-PYTHON` and reference local `roboflow` directory: `from roboflow import Roboflow`
96
-
6. when done, uptick the pip package minor version number in `setup.py`
97
-
7. manually add any new dependencies to the `requirements.txt` and list of dependencies in `setup.py` (careful not to overwrite any packages that might screw up backwards dependencies for object detection, etc.)
90
+
## Developing locally
98
91
99
-
### Code Quality
92
+
### Using Docker
100
93
101
-
We provide a `Makefile` to format and ensure code quality. **Be sure to run them before creating a PR**.
94
+
To set the Docker container up for the first time:
**Note** If you are using [VSCode](https://code.visualstudio.com/) we recommend you read the ["Developing inside a Container"](https://code.visualstudio.com/docs/remote/containers) tutorial.
**Note** This tests will be run automatically when you commit thanks to git hooks.
144
+
### Testing
111
145
112
-
### Tests
146
+
Make sure you have your `virtualenv` spun up before running tests. Execute the `unittest` command at the `/root` level directory.
113
147
114
-
You need to have the following `env` variables,
148
+
Run tests:
115
149
150
+
```bash
151
+
python -m unittest
116
152
```
117
-
ROBOFLOW_API_KEY="<YOUR_ROBOFLOW_API>"
118
-
PROJECT_NAME="<YOUR_PROJECT_NAME>"
119
-
PROJECT_VERSION="" # by default "1"
153
+
154
+
### Contributing
155
+
156
+
1. Increment the pip package minor version number in `setup.py`
157
+
1. Manually add any new dependencies to `requirements.txt` with a version such as `chardet==4.0.0` and list of dependencies in `setup.py` (Be careful not to overwrite any packages that might screw up backwards dependencies for object detection, etc.)
158
+
159
+
### Code Quality
160
+
161
+
When creating new functions, please follow the [Google style Python docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html). See example below:
0 commit comments