Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
## Installation

```bash
$ pip install fastlabel
$ pip install --upgrade fastlabel
```

> Python version 3.8 or greater is required

## Usage

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

```python
import fastlabel
from fastlabel.const import AnalysisType

# Initialize client
client = fastlabel.Client()

# Create predictions
const predictions = [
predictions = [
{
fileKey="sample1.jpg", # file name exists in project
labels=[
"fileKey": "sample1.jpg", # file name exists in your project
"labels": [
{
"value": "line_a", # class value exists in project
"value": "line_a", # class value exists in your project
"points": [
{ "x": 10, "y": 10 },
{ "x": 20, "y": 20 },
Expand All @@ -58,8 +59,8 @@ const predictions = [
# Upload predictions
client.upload_predictions(
project_id="project_id", # your fastlabel project id
analysis_type=AnalysisType.line, # annotation type to be analyze
threshold=20, # IoU percentage/pixel to analyze labels. (Ex: 0 - 100)
analysis_type="line", # annotation type to be analyze ("bbox" or "line" are supported)
threshold=25, # IoU percentage/pixel to analyze labels. (Ex: 0 - 100)
predictions=predictions
)
```
Expand Down
7 changes: 5 additions & 2 deletions fastlabel/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import logging
import os
import requests
from logging import getLogger
from fastlabel.const import AnalysisType

logger = getLogger(__name__)

APP_BASE_URL = "https://app.fastlabel.ai/projects/"
FASTLABEL_ENDPOINT = "https://api-fastlabel-production.web.app/api/v1/"

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


class FastLabelException(Exception):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name="fastlabel",
version="0.1.0",
version="0.1.1",
author="eisuke-ueta",
author_email="eisuke.ueta@fastlabel.ai",
description="The official Python SDK for FastLabel API, the Data Platform for AI",
Expand Down