Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$has_disclaimer is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_meta_box_present is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_send_notification is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_modify_title_and_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_heading is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_blz_affiliation_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskeywords is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_keywordsynonyms is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$response_body is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_indexnow_last_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_oembed_8522fcda6329d0a5a850e72d75061586 is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_oembed_time_8522fcda6329d0a5a850e72d75061586 is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
Computer vision con PaliGemma 2: l'AI riconosce le immagini

Computer vision con PaliGemma 2: l'AI riconosce le immagini

Google presenta PaliGemma 2, un modello generativo avanzato per la visione artificiale che combina analisi visiva e linguistica. Con opzioni di configurazione adattabili (3B, 10B, 28B) e risoluzioni variabili, PaliGemma 2 eccelle nel riconoscimento di contenuti visivi complessi.

Google sta ulteriormente migliorando le abilità di computer visione (visione artificiale) assicurate dai suoi più aggiornati modelli generativi. Il nuovo PaliGemma 2, potente VLM (Vision Language Model) di ultima generazione, raccoglie l’eredità del predecessore PaliGemma presentato a metà maggio 2024 ed è progettato per integrare la comprensione delle immagini con quella del testo, offrendo una soluzione versatile per l’interpretazione di contenuti visivi in modo dettagliato e contestualizzato.

Modello Google PaliGemma 2

Caratteristiche di PaliGemma 2

PaliGemma 2 è disponibile in diverse configurazioni per ottimizzare le performance in base alle necessità specifiche. È infatti possibile scegliere tra modelli di dimensioni variabili (3B, 10B, 28B) e risoluzioni (224 x 224, 448 x 448, 896 x 896 pixel). Queste opzioni permettono di adattare il modello alle varie tipologie di task visivi, mantenendo alte prestazioni anche nella gestione delle applicazioni più complesse.

Una delle caratteristiche distintive di PaliGemma 2 è la sua capacità di generare descrizioni più ricche e dettagliate rispetto ai modelli precedenti. Non si limita a riconoscere oggetti, ma è in grado di creare didascalie che spiegano il movimento, l’emozione e il contesto generale di una scena. Il modello ha dimostrato un’elevata competenza nel riconoscimento di formule chimiche, notazioni musicali, nel “ragionamento spaziale” e nell’analisi di immagini mediche (ad esempio le radiografie toraciche).

Fine-tuning semplice

Un altro grande punto di forza di PaliGemma 2 è la possibilità di effettuare attività di fine-tuning in modo facile e accessibile.

Sviluppatori e ricercatori possono così personalizzare il modello in base a specifici requisiti. Una versatilità che apre a nuovi scenari applicativi in settori che vanno dalla medicina alla chimica, fino alle scienze sociali, permettendo di estrarre informazioni dettagliate da contenuti visivi complessi.

Il modello PaliGemma 2 è reso disponibile attraverso diverse piattaforme (GitHub e Hugging Face) e può essere facilmente integrato in progetti di ricerca o commerciali. Google incoraggia gli sviluppatori a partecipare alla community Gemma, nota come “Gemmaverse“: qui possono condividere i loro progetti e scoprire nuove opportunità di utilizzo.

Da questa pagina Hugging Face, si può scaricare il modello basato su 3 miliardi di parametri (3B) che accetta immagini in input con risoluzione 448 x 448 pixel. Effettuando le opportune sostituzioni nella barra degli indirizzi (3B, 10B, 28B) e 224, 448, 896, si possono scaricare le varie versioni di PaliGemma 2.

Come provare PaliGemma 2 per la computer vision

In questa pagina su Hugging Face è possibile trovare una semplice demo di PaliGemma 2: provate a cliccare sulle immagini in basso quindi cliccate su Submit.

Come potete vedere, il quesito varia. In un caso si chiede al modello di analizzare un grafico e specificare che cosa riguarda. In un altro, PaliGemma 2 è utilizzato per leggere ed estrarre la password presente sulla foto di un supporto cartaceo; in un terzo esempio si chiede di indicare il personaggio raffigurato in un murale.

Computer vision con PaliGemma 2

Con PaliGemma 2, Google apre nuove frontiere nell’interazione tra visione e linguaggio, offrendo agli sviluppatori strumenti potenti per costruire applicazioni AI innovative. La combinazione di prestazioni avanzate e facile personalizzazione, posiziona PaliGemma 2 come uno degli strumenti di punta nel campo dell’intelligenza artificiale visiva.

Come spiegato in questo post introduttivo, per il momento è necessario usare Python, il package manager pip e installare transformers. Per ottimizzare le prestazioni, è importante usare un sistema basato su GPU compatibile CUDA.

Questo esempio che sfrutta semplice codice Python permette di avviare attività di inferenza con PaliGemma 2 per generare didascalie a partire dalle immagini sottoposte al modello. Per ridurre l’utilizzo di memoria e aumentare la velocità di elaborazione, è possibile caricare il modello con quantizzazione a 4 bit usando BitsAndBytesConfig.

PaliGemma 2 in arrivo su Ollama

Ollama, il runner che democratizza l’accesso ai modelli generativi (la loro esecuzione si sposta in locale sui sistemi degli utenti) a breve integrerà anche PaliGemma 2.

Nel frattempo ci si può “accontentare” di Llama 3.2 Vision, un modello sviluppato da Meta che aiuta ad automatizzare l’analisi del contenuto delle immagini. Basta digitare la richiesta (ad esempio l’estrazione di un dato dall’immagine o la generazione di una frase descrittiva del contenuto) e indicare il percorso completo (locale) del file da elaborare.

Computer vision con Llama

Nell’immagine abbiamo chiesto a Llama 3.2 Vision di descrivere il contenuto di questa immagine, scaricata da Unsplash nel formato originale e salvata in locale con il nome di /temp/luise.jpg.

Come spiegato in questo documento di supporto, è possibile interfacciare Llama 3.2 Vision con tutti i principali linguaggi di programmazione. Inoltre, si può beneficiare di framework come Stregatto AI che aiuta a sviluppare componenti personalizzati con la possibilità di integrarli facilmente nei propri progetti software.

Ti consigliamo anche

Link copiato negli appunti