Skip to content

Instantly share code, notes, and snippets.

View raphael0202's full-sized avatar

Raphaël Bournhonesque raphael0202

View GitHub Profile
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "google-genai==1.32.0",
# "pydantic==2.11.7",
# "openfoodfacts==2.9.0",
# "Pillow==11.3.0",
# "typer==0.17.3",
# ]
# ///
@raphael0202
raphael0202 / revert.py
Last active July 24, 2025 10:34
A script to remove taxonomized values from a list of Open Food Facts products
# /// script
# dependencies = [
# "openfoodfacts==2.8.0",
# "typer==0.16.0",
# ]
# ///
"""This script reverts changes made to specific fields of products in the Open Food
Facts database, using the Open Food Facts API.
from pprint import pprint
from PIL import Image
from robotoff.prediction.category.neural.keras_category_classifier_3_0.preprocessing import (
get_ingredient_processor,
)
from robotoff.prediction.ocr.core import get_ocr_result
from robotoff.prediction.ocr.dataclass import (
OCRFullTextAnnotation,

Analysis

barcode: 0735173207047

worker time comment
high_1 11:00:49.536 import image 1.jpg
low_1 11:00:49,740 logo object detection image 1.jpg
high_1 11:00:49.746 finish import image 1.jpg
low_2 11:00:51.822 import image job
@raphael0202
raphael0202 / exclude_list_category.txt
Last active January 5, 2023 10:23
Exclude list for category predictions
en:alcoholic-beverages
en:artisan-products
en:baby-foods
en:bakery-products
en:bee-products
en:belgian-meat-products
en:beverages
en:biscuits-and-cakes
en:breaded-products
en:breakfasts
@raphael0202
raphael0202 / build_triton.sh
Created October 28, 2022 10:07
Custom Triton build
#!/bin/bash
# Clone triton repository and go to v2.26.0 branch:
# https://github.com/triton-inference-server/server/tree/v2.26.0
set -euo pipefail
IFS=$'\n\t'
VERSION='22.09'
@raphael0202
raphael0202 / requirements.txt
Last active June 1, 2022 01:40
Training script for the blog post "How many layers of my BERT model should I freeze?"
scikit-learn==0.23.2
datasets==1.1.3
torch==1.7.0
transformers==3.5.1
@raphael0202
raphael0202 / off_cat_classification.ipynb
Last active October 28, 2018 15:26
OFF category classification
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.