Skip to content

Commit e8ca00a

Browse files
Merge pull request #74 from FocoosAI/hotifix/documentation
docs: Update documentation links and Colab notebook references
2 parents e887b77 + 5aa735e commit e8ca00a

File tree

12 files changed

+86
-79
lines changed

12 files changed

+86
-79
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: venv test install install-dev install-pre-commit run-pre-commit .uv .pre-commit tox
1+
.PHONY: venv test install install-gpu run-pre-commit .uv .pre-commit tox
22

33
.uv: ## Check that uv is installed
44
@uv --version || echo 'Please install uv: https://docs.astral.sh/uv/getting-started/installation/'
@@ -10,7 +10,7 @@ venv:
1010
@uv venv --python=python3.12
1111

1212
install: .uv .pre-commit
13-
@uv pip install -e ".[cuda,dev]" --no-cache-dir
13+
@uv pip install -e ".[dev]" --no-cache-dir
1414
@pre-commit install
1515

1616
install-gpu: .uv .pre-commit

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,32 @@ Whether you're deploying in the cloud or on edge devices, the Focoos Python SDK
2626
Deploy the model on your devices or use it on our servers. Download the model to run it locally, without sending any data over the network, ensuring full privacy.
2727

2828

29-
### Quickstart 🚀
29+
## Quickstart 🚀
3030
Ready to dive in? Get started with the setup in just a few simple steps!
3131

32+
### Installation
3233
**Install** the Focoos Python SDK (for more options, see [setup](https://focoosai.github.io/focoos/setup))
3334

3435
**uv**
3536
```bash linenums="0"
3637
uv pip install 'focoos @ git+https://github.com/FocoosAI/focoos.git'
3738
```
3839

39-
**pip**
40+
**pip**, **conda**
4041
```bash linenums="0"
4142
pip install 'focoos @ git+https://github.com/FocoosAI/focoos.git'
4243
```
4344

44-
**conda**
45-
```bash linenums="0"
46-
conda install pip # if you don't have it already
47-
pip install 'focoos @ git+https://github.com/FocoosAI/focoos.git'
48-
```
45+
### Inference
46+
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/FocoosAI/focoos/blob/main/notebooks/inference.ipynb)
4947

5048
🚀 [Directly use](https://focoosai.github.io/focoos/how_to/inference/) our **Efficient Models**, optimized for different data, applications, and hardware.
5149

50+
51+
5252
```python
5353
from focoos import Focoos
54+
from PIL import Image
5455

5556
# Initialize the Focoos client with your API key
5657
focoos = Focoos(api_key="<YOUR-API-KEY>")
@@ -59,14 +60,19 @@ focoos = Focoos(api_key="<YOUR-API-KEY>")
5960
model = focoos.get_remote_model("fai-rtdetr-m-obj365")
6061

6162
# Run inference on an image
62-
detections, _ = model.infer(image_path, threshold=0.4)
63+
detections, preview = model.infer(image_path, annotate=True)
6364

6465
# Output the detections
65-
print(detections)
66+
Image.fromarray(preview)
6667
```
6768

69+
### Training
70+
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/FocoosAI/focoos/blob/main/notebooks/training.ipynb)
71+
6872
⚙️ **Customize** the models to your specific needs by [fine-tuning](https://focoosai.github.io/focoos/how_to/cloud_training/) on your own dataset.
6973

74+
75+
7076
```python
7177
from focoos import Focoos
7278
from focoos.ports import Hyperparameters
@@ -88,7 +94,7 @@ res = model.train(
8894

8995
See more examples in the [how to](https://focoosai.github.io/focoos/how_to) section.
9096

91-
### Our Models 🧠
97+
## Our Models 🧠
9298
Focoos AI offers the best models in object detection, semantic and instance segmentation, and more is coming soon.
9399

94100
Using Focoos AI helps you save both time and money while delivering high-performance AI models 💪:

docs/how_to/cloud_training.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This section covers the steps to create a model and train it in the cloud using the `focoos` library. The following example demonstrates how to interact with the Focoos API to manage models, datasets, and training jobs.
44

5-
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/FocoosAI/focoos/blob/documentation%2Fnomenclature/notebooks/training.ipynb)
5+
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/FocoosAI/focoos/blob/main/notebooks/training.ipynb)
66

77
In this guide, we will perform the following steps:
88

@@ -17,7 +17,7 @@ In this guide, we will perform the following steps:
1717
## 1. Load or select a dataset
1818
!!! note
1919
Currently, we are not supporting dataset creation from the SDK (it's coming really soon) and you can only use a dataset already available on the platform.
20-
To upload your own dataset, you can write us a mail to [info@focoos.ai](mailto:info@focoos.ai) and we will load your dataset on the platform on your private workspace (your data will not be shared with anyone and not used for any other purpose than training your model).
20+
To upload your own dataset, you can write us a mail to [support@focoos.ai](mailto:support@focoos.ai) and we will load your dataset on the platform on your private workspace (your data will not be shared with anyone and not used for any other purpose than training your model).
2121

2222
You can list all available datasets using the following code:
2323
```python
@@ -36,7 +36,7 @@ dataset_ref = "<YOUR-DATASET-REFERENCE>"
3636

3737
## 2. Create a model
3838
The first step to personalize your model is to create a model.
39-
You can create a model by calling the [`new_model` method](/api/focoos/#focoos.Focoos.new_model) on the `Focoos` object. You can choose the model you want to personalize from the list of [Focoos Models](/models) available on the platform. Make sure to select the correct model for your task.
39+
You can create a model by calling the [`new_model` method](/focoos/api/focoos/#focoos.focoos.Focoos.new_model) on the `Focoos` object. You can choose the model you want to personalize from the list of [Focoos Models](../models.md) available on the platform. Make sure to select the correct model for your task.
4040

4141
```python
4242
from focoos import Focoos
@@ -57,10 +57,10 @@ model = focoos.new_model(
5757
focoos_model="fai-rtdetr-m-obj365",
5858
)
5959
```
60-
This function will return a new [`RemoteModel`](/api/remote_model) object that you can use to train the model and to perform remote inference.
60+
This function will return a new [`RemoteModel`](/focoos/api/remote_model/#focoos.remote_model.RemoteModel) object that you can use to train the model and to perform remote inference.
6161

6262
## 3. Train the model
63-
Once the model is created, you can start the training process by calling the [`train` method](/api/remote_model/#focoos.remote_model.RemoteModel.train) on the model object.
63+
Once the model is created, you can start the training process by calling the [`train` method](/focoos/api/remote_model/#focoos.remote_model.RemoteModel.train) on the model object.
6464

6565
```python
6666
from focoos.ports import Hyperparameters
@@ -75,42 +75,42 @@ res = model.train(
7575
)
7676
```
7777
For selecting the `dataset_ref` see the [step 1](#1-load-or-select-a-dataset).
78-
You can further customize the training process by passing additional parameters to the [`train` method](/api/remote_model/#focoos.remote_model.RemoteModel.train) (such as the instance type, the volume size, the maximum runtime, etc.) or use additional hyperparameters (see the list [available hyperparameters](/api/ports/#focoos.ports.Hyperparameters)).
78+
You can further customize the training process by passing additional parameters to the [`train` method](/focoos/api/remote_model/#focoos.remote_model.RemoteModel.train) (such as the instance type, the volume size, the maximum runtime, etc.) or use additional hyperparameters (see the list [available hyperparameters](/focoos/api/ports/#focoos.ports.Hyperparameters)).
7979

80-
Futhermore, you can monitor the training progress by polling the training status. Use the [`notebook_monitor_train`](/api/remote_model/#focoos.remote_model.RemoteModel.notebook_monitor_train) method on a jupyter notebook:
80+
Futhermore, you can monitor the training progress by polling the training status. Use the [`notebook_monitor_train`](/focoos/api/remote_model/#focoos.remote_model.RemoteModel.notebook_monitor_train) method on a jupyter notebook:
8181
```python
8282
model.notebook_monitor_train(interval=30, plot_metrics=True)
8383
```
8484

85-
You can also get the training logs by calling the [`train_logs` method](/api/remote_model/#focoos.remote_model.RemoteModel.train_logs):
85+
You can also get the training logs by calling the [`train_logs` method](/focoos/api/remote_model/#focoos.remote_model.RemoteModel.train_logs):
8686
```python
8787
logs = model.train_logs()
8888
pprint(logs)
8989
```
9090

91-
Finally, if for some reason you need to cancel the training, you can do so by calling the [`stop_training` method](/api/remote_model/#focoos.remote_model.RemoteModel.stop_training):
91+
Finally, if for some reason you need to cancel the training, you can do so by calling the [`stop_training` method](/focoos/api/remote_model/#focoos.remote_model.RemoteModel.stop_training):
9292
```python
9393
model.stop_training()
9494
```
9595

9696
## 4. Visualize training metrics
97-
You can visualize the training metrics by calling the [`metrics` method](/api/remote_model/#focoos.remote_model.RemoteModel.metrics):
97+
You can visualize the training metrics by calling the [`metrics` method](/focoos/api/remote_model/#focoos.remote_model.RemoteModel.metrics):
9898
```python
9999
metrics = model.metrics()
100100
visualizer = MetricsVisualizer(metrics)
101101
visualizer.log_metrics()
102102
```
103-
The function will return an object of type [`Metrics`](/api/ports/#focoos.ports.Metrics) that you can use to visualize the training metrics using a `MetricsVisualizer` object.
103+
The function will return an object of type [`Metrics`](/focoos/api/ports/#focoos.ports.Metrics) that you can use to visualize the training metrics using a `MetricsVisualizer` object.
104104

105-
On notebooks, you can also plot the metrics by calling the [`notebook_plot_training_metrics`](/api/remote_model/#focoos.remote_model.RemoteModel.notebook_plot_training_metrics) method:
105+
On notebooks, you can also plot the metrics by calling the [`notebook_plot_training_metrics`](/focoos/api/remote_model/#focoos.remote_model.RemoteModel.notebook_plot_training_metrics) method:
106106
```python
107107
visualizer.notebook_plot_training_metrics()
108108
```
109109

110110
## 5. Test your model
111111

112112
### Remote Inference
113-
Once the training is over, you can test your model using remote inference by calling the [`infer` method](/api/remote_model/#focoos.remote_model.RemoteModel.infer) on the model object.
113+
Once the training is over, you can test your model using remote inference by calling the [`infer` method](/focoos/api/remote_model/#focoos.remote_model.RemoteModel.infer) on the model object.
114114

115115
```python
116116
image_path = "<PATH-TO-YOUR-IMAGE>"
@@ -122,7 +122,7 @@ for det in result.detections:
122122
if det.mask:
123123
print("Instance segmentation mask included")
124124
```
125-
`result` is a [FocoosDetections](/api/ports/#focoos.ports.FocoosDetections) object, containing a list of [FocoosDet](/api/ports/#focoos.ports.FocoosDet) objects and optionally a dict of information about the latency of the inference.
125+
`result` is a [FocoosDetections](/focoos/api/ports/#focoos.ports.FocoosDetections) object, containing a list of [FocoosDet](/focoos/api/ports/#focoos.ports.FocoosDet) objects and optionally a dict of information about the latency of the inference.
126126

127127
The `threshold` parameter is optional and defines the minimum confidence score for a detection to be considered valid (predictions with a confidence score lower than the threshold are discarded).
128128

@@ -136,9 +136,9 @@ preview = Image.fromarray(preview[:,:,[2,1,0]]) # invert to make it RGB
136136

137137
### Local Inference
138138
!!! Note
139-
To perform local inference, you need to install the package with one of the extra modules (`[cpu]`, `[torch]`, `[cuda]`, `[tensorrt]`). See the [installation](./setup.md) page for more details.
139+
To perform local inference, you need to install the package with one of the extra modules (`[cpu]`, `[torch]`, `[cuda]`, `[tensorrt]`). See the [installation](../setup.md) page for more details.
140140

141-
You can perform inference locally by getting the [`LocalModel`](/api/local_model) you already trained and calling the [`infer` method](/api/local_model/#focoos.local_model.LocalModel.infer) on your image. If it's the first time you run the model locally, the model will be downloaded from the cloud and saved on your machine. Additionally, if you use CUDA or TensorRT, the model will be optimized for your GPU before running the inference (it can take few seconds, especially for TensorRT).
141+
You can perform inference locally by getting the [`LocalModel`](/focoos/api/local_model) you already trained and calling the [`infer` method](/focoos/api/local_model/#focoos.local_model.LocalModel.infer) on your image. If it's the first time you run the model locally, the model will be downloaded from the cloud and saved on your machine. Additionally, if you use CUDA or TensorRT, the model will be optimized for your GPU before running the inference (it can take few seconds, especially for TensorRT).
142142

143143
```python
144144
model = focoos.get_local_model(model.model_ref) # get the local model

docs/how_to/dashboard.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This section covers the steps to monitor the status of your models on the FocoosAI platform.
44

5-
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/FocoosAI/focoos/blob/documentation%2Fnomenclature/notebooks/model_management.ipynb)
5+
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/FocoosAI/focoos/blob/main/notebooks/model_management.ipynb)
66

77
## How to list the Focoos Models
88
To list all the models available on the FocoosAI platform, you can use the following code:
@@ -22,14 +22,14 @@ for model in models:
2222

2323

2424
```
25-
`models` is a list of [`ModelPreview`](/api/ports/#focoos.ports.ModelPreview) objects that contains the following information:
25+
`models` is a list of [`ModelPreview`](/focoos/api/ports/#focoos.ports.ModelPreview) objects that contains the following information:
2626

2727
- `name`: The name of the model.
2828
- `ref`: The reference of the model.
2929
- `status`: The status of the model.
3030
- `task`: The task of the model.
3131
- `description`: The description of the model.
32-
- `status`: The status of the model, which indicates its current state (e.g. CREATED, TRAINING_RUNNING, TRAINING_COMPLETED - see [`ModelStatus`](/api/ports/#focoos.ports.ModelStatus)).
32+
- `status`: The status of the model, which indicates its current state (e.g. CREATED, TRAINING_RUNNING, TRAINING_COMPLETED - see [`ModelStatus`](/focoos/api/ports/#focoos.ports.ModelStatus)).
3333

3434
## How to list all your models
3535
To list all your models, the library provides a `list_models` function. This function will return a list of `Model` objects.
@@ -50,18 +50,18 @@ for model in models:
5050
print("-" * 50)
5151

5252
```
53-
`models` is a list of [`ModelPreview`](/api/ports/#focoos.ports.ModelPreview) objects that contains the following information:
53+
`models` is a list of [`ModelPreview`](/focoos/api/ports/#focoos.ports.ModelPreview) objects that contains the following information:
5454

5555
- `name`: The name of the model.
5656
- `ref`: The reference of the model.
5757
- `status`: The status of the model.
5858
- `task`: The task of the model.
5959
- `description`: The description of the model.
6060
- `focoos_model`: The starting Focoos Model used for training.
61-
- `status`: The status of the model, which indicates its current state (e.g. CREATED, TRAINING_RUNNING, TRAINING_COMPLETED - see [`ModelStatus`](/api/ports/#focoos.ports.ModelStatus)).
61+
- `status`: The status of the model, which indicates its current state (e.g. CREATED, TRAINING_RUNNING, TRAINING_COMPLETED - see [`ModelStatus`](/focoos/api/ports/#focoos.ports.ModelStatus)).
6262

6363
## See the metrics for a model
64-
To see the validation metrics of a model, you can use the [`metrics` method](/api/remote_model/#focoos.remote_model.RemoteModel.metrics) on the model object.
64+
To see the validation metrics of a model, you can use the [`metrics` method](/focoos/api/remote_model/#focoos.remote_model.RemoteModel.metrics) on the model object.
6565

6666
```python
6767
from focoos import Focoos
@@ -87,10 +87,10 @@ if metrics.train_metrics:
8787
print(f" {k}: {v}")
8888

8989
```
90-
`metrics` is a [`Metrics`](/api/ports/#focoos.ports.Metrics) object that contains the validation metrics of the model.
90+
`metrics` is a [`Metrics`](/focoos/api/ports/#focoos.ports.Metrics) object that contains the validation metrics of the model.
9191

9292
## Delete a model
93-
To delete a model, you can use the [`delete_model` method](/api/remote_model/#focoos.remote_model.RemoteModel.delete_model) on the model object.
93+
To delete a model, you can use the [`delete_model` method](/focoos/api/remote_model/#focoos.remote_model.RemoteModel.delete_model) on the model object.
9494

9595
!!! warning
9696
This action is irreversible and the model will be deleted forever from the platform.
@@ -122,7 +122,7 @@ for dataset in datasets:
122122
print("-" * 50)
123123
124124
```
125-
`datasets` is a list of [`DatasetMetadata`](../../api/ports/#focoos.ports.DatasetMetadata) objects that contains the following information:
125+
`datasets` is a list of [`DatasetMetadata`](/focoos/api/ports/#focoos.ports.DatasetMetadata) objects that contains the following information:
126126
127127
- `name`: The name of the dataset.
128128
- `ref`: The reference of the dataset.

0 commit comments

Comments
 (0)