|
15 | 15 |
|
16 | 16 | JUST CHECKING IF THIS RENDERS???
|
17 | 17 |
|
18 |
| -.. code-block:: python |
19 | 18 | ::
|
20 |
| - import nucleus |
21 |
| - client = nucleus.NucleusClient("YOUR_SCALE_API_KEY") |
22 |
| - prediction_1 = nucleus.BoxPrediction(label="label", x=0, y=0, width=10, height=10, reference_id="1", confidence=0.9, class_pdf={'label': 0.9, 'other_label': 0.1}) |
23 |
| - prediction_2 = nucleus.BoxPrediction(label="label", x=0, y=0, width=10, height=10, reference_id="2", confidence=0.2, class_pdf={'label': 0.2, 'other_label': 0.8}) |
24 |
| - model = client.add_model(name="My Model", reference_id="My-CNN", metadata={"timestamp": "121012401"}) |
25 |
| - # For small ingestions, we recommend synchronous ingestion |
26 |
| - response = dataset.upload_predictions(model, [prediction_1, prediction_2]) |
27 |
| - # For large ingestions, we recommend asynchronous ingestion |
28 |
| - job = dataset.upload_predictions([prediction_1, prediction_2], asynchronous=True) |
29 |
| - # Check current status |
30 |
| - job.status() |
31 |
| - # Sleep until ingestion is done |
32 |
| - job.sleep_until_complete() |
33 |
| - # Check errors |
34 |
| - job.errors() |
| 19 | +import nucleus |
| 20 | +client = nucleus.NucleusClient("YOUR_SCALE_API_KEY") |
| 21 | +prediction_1 = nucleus.BoxPrediction(label="label", x=0, y=0, width=10, height=10, reference_id="1", confidence=0.9, class_pdf={'label': 0.9, 'other_label': 0.1}) |
| 22 | +prediction_2 = nucleus.BoxPrediction(label="label", x=0, y=0, width=10, height=10, reference_id="2", confidence=0.2, class_pdf={'label': 0.2, 'other_label': 0.8}) |
| 23 | +model = client.add_model(name="My Model", reference_id="My-CNN", metadata={"timestamp": "121012401"}) |
| 24 | +# For small ingestions, we recommend synchronous ingestion |
| 25 | +response = dataset.upload_predictions(model, [prediction_1, prediction_2]) |
| 26 | +# For large ingestions, we recommend asynchronous ingestion |
| 27 | +job = dataset.upload_predictions([prediction_1, prediction_2], asynchronous=True) |
| 28 | +# Check current status |
| 29 | +job.status() |
| 30 | +# Sleep until ingestion is done |
| 31 | +job.sleep_until_complete() |
| 32 | +# Check errors |
| 33 | +job.errors() |
| 34 | +:: |
35 | 35 | """
|
36 | 36 | from typing import List, Optional, Dict, Union
|
37 | 37 | from .dataset import Dataset
|
|
0 commit comments