Skip to content

Commit

Permalink
feat(rerun): add French version
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanpaget authored Dec 12, 2023
1 parent d7d7f6f commit e64219d
Show file tree
Hide file tree
Showing 2 changed files with 316 additions and 0 deletions.
316 changes: 316 additions & 0 deletions docs/fr/1-Experiences/bloc-notes/ReRun_FR.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,316 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "1bd46748-42b9-46ea-9fea-fee20634a793",
"metadata": {},
"source": [
"# ReRun : Visualisez tout rapidement et efficacement !\n",
"\n",
"Bienvenue dans le monde de ReRun, votre SDK incontournable pour visualiser des données multimodales qui évoluent dynamiquement avec le temps. Les ingénieurs et chercheurs dans des domaines tels que la vision par ordinateur et la robotique utilisent ReRun pour vérifier, déboguer et présenter leurs projets avec une efficacité inégalée.\n",
"\n",
"![Multimodal Timeseries Data](./img/rerun-multi-1.png)\n",
"\n",
"## Points Forts\n",
"\n",
"- **Modèle Open-Core :** ReRun fonctionne sur un modèle open-core, garantissant que tout dans ce référentiel reste open source et gratuit. À l'avenir, ReRun introduira un produit commercial construit sur la base solide du projet de base gratuit.\n",
"\n",
"- **Adapté aux individus et aux équipes :** Le projet open source répond aux besoins des développeurs individuels, tandis que le futur produit commercial abordera spécifiquement les exigences des équipes impliquées dans la construction et l'exécution de produits de vision par ordinateur et de robotique.\n",
"\n",
"- **Polyvalent et multiplateforme :** ReRun est un SDK et un moteur conçu pour visualiser et interagir avec des flux de données multimodaux. Il est simple à intégrer et à démarrer, utilisable à partir de Python, Rust et C++, et construit en Rust pour une compatibilité multiplateforme et une rapidité optimale.\n",
"\n",
"- **Open Source :** ReRun s'engage envers les principes open source, avec une double licence MIT et Apache 2.\n",
"\n",
"## Installation\n",
"\n",
"Pour libérer la puissance de ReRun, installez-le dans votre environnement JupyterLab avec une commande simple :"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d9f41c51-e09f-4a37-b5e6-3ff4766001ea",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%capture\n",
"! pip install -U rerun-sdk"
]
},
{
"cell_type": "markdown",
"id": "b421be69-2741-4d5c-a3fa-f60f8d9187aa",
"metadata": {
"tags": []
},
"source": [
"## Démarrage\n",
"\n",
"Pour une expérience ReRun optimale, il est recommandé d'utiliser une session de bureau Linux, Mac ou Windows au lieu de JupyterLab. Accédez au visualiseur ReRun complet avec :\n",
"\n",
"\n",
"``` python\n",
"import rerun as rr\n",
"\n",
"rr.spawn()\n",
"```\n",
"\n",
"Cependant, si JupyterLab est votre environnement préféré, ReRun y fonctionne de manière transparente. Reportez-vous à [consulter la documentation officielle](https://www.rerun.io/docs/howto/notebook) pour plus de détails sur l'exécution de ReRun dans JupyterLab. L'exemple JupyterLab le plus simple consiste à ouvrir ReRun à l'aide des méthodes `memory_recording()` et `show()` :"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e9918233",
"metadata": {},
"outputs": [],
"source": [
"import rerun as rr\n",
"\n",
"rec = rr.memory_recording()\n",
"rec.show(width=1024, height=768)"
]
},
{
"cell_type": "markdown",
"id": "b84e8b9d",
"metadata": {},
"source": [
"## Visualisation 3D : Le Cube\n",
"\n",
"Découvrez la simplicité de la visualisation 3D avec ReRun en générant et en traçant des points dans l'espace :"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a7127bbc",
"metadata": {},
"outputs": [],
"source": [
"import rerun as rr\n",
"import numpy as np\n",
"\n",
"rec = rr.memory_recording()\n",
"\n",
"SIZE = 10\n",
"\n",
"pos_grid = np.meshgrid(*[np.linspace(-10, 10, SIZE)]*3)\n",
"positions = np.vstack([d.reshape(-1) for d in pos_grid]).T\n",
"\n",
"col_grid = np.meshgrid(*[np.linspace(0, 255, SIZE)]*3)\n",
"colors = np.vstack([c.reshape(-1) for c in col_grid]).astype(np.uint8).T\n",
"\n",
"rr.log(\n",
" \"my_points\",\n",
" rr.Points3D(positions, colors=colors, radii=0.5)\n",
")\n",
"\n",
"rec.show(width=1024, height=768)"
]
},
{
"cell_type": "markdown",
"id": "759d2169",
"metadata": {},
"source": [
"## Visualisation 3D avancée : L'ADN\n",
"\n",
"Explorez un exemple fascinant de visualisation synthétique de données 3D en forme de double hélice :"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e9bd9a87",
"metadata": {},
"outputs": [],
"source": [
"from __future__ import annotations\n",
"\n",
"import argparse\n",
"from math import tau\n",
"\n",
"import numpy as np\n",
"\n",
"import rerun as rr # pip install rerun-sdk\n",
"from rerun.utilities import bounce_lerp, build_color_spiral\n",
"\n",
"rec = rr.memory_recording()\n",
"\n",
"rr.set_time_seconds(\"stable_time\", 0)\n",
"\n",
"NUM_POINTS = 100\n",
"\n",
"# points and colors are both np.array((NUM_POINTS, 3))\n",
"points1, colors1 = build_color_spiral(NUM_POINTS)\n",
"points2, colors2 = build_color_spiral(NUM_POINTS, angular_offset=tau * 0.5)\n",
"rr.log(\"helix/structure/left\", rr.Points3D(points1, colors=colors1, radii=0.08))\n",
"rr.log(\"helix/structure/right\", rr.Points3D(points2, colors=colors2, radii=0.08))\n",
"\n",
"rr.log(\"helix/structure/scaffolding\", rr.LineStrips3D(np.stack((points1, points2), axis=1), colors=[128, 128, 128]))\n",
"\n",
"time_offsets = np.random.rand(NUM_POINTS)\n",
"for i in range(400):\n",
" time = i * 0.01\n",
" rr.set_time_seconds(\"stable_time\", time)\n",
"\n",
" times = np.repeat(time, NUM_POINTS) + time_offsets\n",
" beads = [bounce_lerp(points1[n], points2[n], times[n]) for n in range(NUM_POINTS)]\n",
" colors = [[int(bounce_lerp(80, 230, times[n] * 2))] for n in range(NUM_POINTS)]\n",
" rr.log(\n",
" \"helix/structure/scaffolding/beads\", rr.Points3D(beads, radii=0.06, colors=np.repeat(colors, 3, axis=-1))\n",
" )\n",
"\n",
" rr.log(\n",
" \"helix/structure\",\n",
" rr.Transform3D(rotation=rr.RotationAxisAngle(axis=[0, 0, 1], radians=time / 4.0 * tau)),\n",
" )\n",
"\n",
"rec.show(width=1024, height=768)"
]
},
{
"cell_type": "markdown",
"id": "cb0cbca9",
"metadata": {},
"source": [
"## Données de séries temporelles : Des graphiques impressionnants\n",
"\n",
"ReRun brille vraiment lors de la visualisation de données de séries temporelles multi-modales. L'exemple suivant démontre l'efficacité de ReRun en affichant divers graphiques correspondant à différentes lectures sur les mêmes données de séries temporelles :"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "de21e1f2",
"metadata": {},
"outputs": [],
"source": [
"from __future__ import annotations\n",
"\n",
"import argparse\n",
"import random\n",
"from math import cos, sin, tau\n",
"\n",
"import numpy as np\n",
"import rerun as rr # pip install rerun-sdk\n",
"\n",
"rec = rr.memory_recording()\n",
"\n",
"def clamp(n, smallest, largest): # type: ignore[no-untyped-def]\n",
" return max(smallest, min(n, largest))\n",
"\n",
"\n",
"def log_bar_chart() -> None:\n",
" rr.set_time_sequence(\"frame_nr\", 0)\n",
" # Log a gauss bell as a bar chart\n",
" mean = 0\n",
" std = 1\n",
" variance = np.square(std)\n",
" x = np.arange(-5, 5, 0.1)\n",
" y = np.exp(-np.square(x - mean) / 2 * variance) / (np.sqrt(2 * np.pi * variance))\n",
" rr.log(\"bar_chart\", rr.BarChart(y))\n",
"\n",
"\n",
"def log_parabola() -> None:\n",
" # Log a parabola as a time series\n",
" for t in range(0, 1000, 10):\n",
" rr.set_time_sequence(\"frame_nr\", t)\n",
"\n",
" f_of_t = (t * 0.01 - 5) ** 3 + 1\n",
" radius = clamp(abs(f_of_t) * 0.1, 0.5, 10.0)\n",
" color = [255, 255, 0]\n",
" if f_of_t < -10.0:\n",
" color = [255, 0, 0]\n",
" elif f_of_t > 10.0:\n",
" color = [0, 255, 0]\n",
"\n",
" rr.log(\n",
" \"curves/parabola\",\n",
" rr.TimeSeriesScalar(\n",
" f_of_t,\n",
" label=\"f(t) = (0.01t - 3)³ + 1\",\n",
" radius=radius,\n",
" color=color,\n",
" ),\n",
" )\n",
"\n",
"\n",
"def log_trig() -> None:\n",
" # Log a time series\n",
" for t in range(0, int(tau * 2 * 100.0)):\n",
" rr.set_time_sequence(\"frame_nr\", t)\n",
"\n",
" sin_of_t = sin(float(t) / 100.0)\n",
" rr.log(\"trig/sin\", rr.TimeSeriesScalar(sin_of_t, label=\"sin(0.01t)\", color=[255, 0, 0]))\n",
"\n",
" cos_of_t = cos(float(t) / 100.0)\n",
" rr.log(\"trig/cos\", rr.TimeSeriesScalar(cos_of_t, label=\"cos(0.01t)\", color=[0, 255, 0]))\n",
"\n",
"\n",
"def log_classification() -> None:\n",
" # Log a time series\n",
" for t in range(0, 1000, 2):\n",
" rr.set_time_sequence(\"frame_nr\", t)\n",
"\n",
" f_of_t = (2 * 0.01 * t) + 2\n",
" color = [255, 255, 0]\n",
" rr.log(\"classification/line\", rr.TimeSeriesScalar(f_of_t, color=color, radius=3.0))\n",
"\n",
" g_of_t = f_of_t + random.uniform(-5.0, 5.0)\n",
" if g_of_t < f_of_t - 1.5:\n",
" color = [255, 0, 0]\n",
" elif g_of_t > f_of_t + 1.5:\n",
" color = [0, 255, 0]\n",
" else:\n",
" color = [255, 255, 255]\n",
" radius = abs(g_of_t - f_of_t)\n",
" rr.log(\"classification/samples\", rr.TimeSeriesScalar(g_of_t, color=color, scattered=True, radius=radius))\n",
"\n",
"\n",
"log_bar_chart()\n",
"log_parabola()\n",
"log_trig()\n",
"log_classification()\n",
"\n",
"rec.show(width=1024, height=768)\n"
]
},
{
"cell_type": "markdown",
"id": "d9bd7e11",
"metadata": {},
"source": [
"## Plongez plus profondément\n",
"\n",
"Pour une compréhension approfondie de ReRun et de ses fonctionnalités, reportez-vous au [démarrage rapide officiel de ReRun Python](https://www.rerun.io/docs/quickstart/python/).\n",
"\n",
"Désormais, armé de ReRun, embarquez pour un voyage de visualisation et d’exploration de données sans précédent. Bon codage !"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e64219d

Please sign in to comment.