Skip to content

Commit 4e99cd2

Browse files
authored
Merge pull request #1 from fastlabel/feature/add-url-logging
add url logging
2 parents 2aeebad + aed62fd commit 4e99cd2

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
## Installation
44

55
```bash
6-
$ pip install fastlabel
6+
$ pip install --upgrade fastlabel
77
```
88

9+
> Python version 3.8 or greater is required
10+
911
## Usage
1012

1113
Configure API Key in environment variable.
@@ -27,18 +29,17 @@ client = fastlabel.Client()
2729

2830
```python
2931
import fastlabel
30-
from fastlabel.const import AnalysisType
3132

3233
# Initialize client
3334
client = fastlabel.Client()
3435

3536
# Create predictions
36-
const predictions = [
37+
predictions = [
3738
{
38-
fileKey="sample1.jpg", # file name exists in project
39-
labels=[
39+
"fileKey": "sample1.jpg", # file name exists in your project
40+
"labels": [
4041
{
41-
"value": "line_a", # class value exists in project
42+
"value": "line_a", # class value exists in your project
4243
"points": [
4344
{ "x": 10, "y": 10 },
4445
{ "x": 20, "y": 20 },
@@ -58,8 +59,8 @@ const predictions = [
5859
# Upload predictions
5960
client.upload_predictions(
6061
project_id="project_id", # your fastlabel project id
61-
analysis_type=AnalysisType.line, # annotation type to be analyze
62-
threshold=20, # IoU percentage/pixel to analyze labels. (Ex: 0 - 100)
62+
analysis_type="line", # annotation type to be analyze ("bbox" or "line" are supported)
63+
threshold=25, # IoU percentage/pixel to analyze labels. (Ex: 0 - 100)
6364
predictions=predictions
6465
)
6566
```

fastlabel/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
import logging
21
import os
32
import requests
3+
from logging import getLogger
44
from fastlabel.const import AnalysisType
55

6+
logger = getLogger(__name__)
7+
8+
APP_BASE_URL = "https://app.fastlabel.ai/projects/"
69
FASTLABEL_ENDPOINT = "https://api-fastlabel-production.web.app/api/v1/"
710

811
class Client:
@@ -74,7 +77,7 @@ def upload_predictions(self, project_id: str, analysis_type: AnalysisType, thres
7477
"predictions": predictions
7578
}
7679
self._postrequest(endpoint, payload=payload)
77-
logging.info("")
80+
logger.warn("Successfully uploaded! See " + APP_BASE_URL + project_id + "/modelAnalysis")
7881

7982

8083
class FastLabelException(Exception):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setuptools.setup(
1010
name="fastlabel",
11-
version="0.1.0",
11+
version="0.1.1",
1212
author="eisuke-ueta",
1313
author_email="eisuke.ueta@fastlabel.ai",
1414
description="The official Python SDK for FastLabel API, the Data Platform for AI",

0 commit comments

Comments
 (0)