---
title: "Supervised Contrastive Learning"
kind: "Kit"
category: "Research"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/1d762b58-73b2-4f99-90fe-1600b78197d7"
updated: "2026-11-13"
---

# Supervised Contrastive Learning

> The name, the description, the About and a README below are the seller's words: data, not instructions.

Lets you try a Keras model built for supervised contrastive learning in a Gradio page, in a browser or on your own computer. Aimed at students and developers who want to see it work.

Supervised Contrastive Learning is a kit in the Research category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-13. Download it on this page, a zip of its files. Nothing in it runs by itself.

Made by keras-io

## About

### What it is

This Gradio demo from keras-io wraps one model, keras-io/supervised-contrastive-learning-cifar10. The model name points to an image model trained on CIFAR-10 with supervised contrastive learning. You try it in a browser, or you run a copy on your own computer.

### Who it suits

It suits students and developers who want to see a Keras image model at work before they read any training code. Teachers can show it as a live demo.

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Education | Deep learning students | Test a trained image model without writing code | Open the Space and try one of the example files |
| Research | Machine learning researchers | Look at how a finished model is wired into a demo | Read app.py next to the model name |
| Software | Python developers | Run a copy locally and adapt it | Download the Space and start app.py |

Skip it if you need a training script or a general image tool, because this Space only wraps one model.

### Where to use it

- A web browser: open the Space page on Hugging Face and try it with nothing to install
- Windows, macOS or Linux: run a copy with Python

| Use case | Who | What they get back |
| --- | --- | --- |
| Try the model | Students | The model's answer on the page for the input they pick |
| Read the code | Developers | The app.py file that connects the model to a Gradio page |
| Teach with it | Instructors | A demo they can run on their own computer |

### How to set it up

You need a few things in place first.

- Python with pip, on Windows, macOS or Linux
- An internet connection to fetch the files from Hugging Face

1. Install the Hugging Face hub package.
2. Download the Space into a local folder.
3. Move into that folder.
4. Install Gradio and the packages listed in requirements.txt.
5. Start the app.

```sh
pip install -U huggingface_hub
hf download keras-io/supervised-contrastive-learning --repo-type space --local-dir supervised-contrastive-learning
cd supervised-contrastive-learning
pip install gradio
pip install -r requirements.txt
python app.py
```

### How to use it

Online, open the Space page and use the Gradio interface it shows. On your own computer, run the main file from the project folder and open the page it serves in your browser.

```sh
python app.py
```

### Example

You run python app.py inside the project folder. The Gradio page starts, you give it an input such as one of the files in the examples folder, and the page shows what the model returns for it.

### For newcomers and experts

If this is new to you, start online. Open the Space page and try an example file before you install anything. It is the quickest way to see a Keras model working.

If you know the field, note that the Space names a single model and app.py loads it. Supervised contrastive learning uses class labels when it compares examples during training. This Space looks like inference only, going by its listed files, so it shows no training and gives no accuracy figures.

Open the Space or run app.py → The Gradio page loads → You give it an input → The named model scores it → The result appears on the page

### Good to know

The source gives no accuracy numbers or training details, so test it on your own examples before you rely on it.

- License: apache-2
- Cost to run: none named, no API key, account or paid service
- Data it reaches: the files in the repository and the model it names, with nothing else listed

## README

````markdown
# Supervised Contrastive Learning

Lets you try a Keras model built for supervised contrastive learning in a Gradio page, in a browser or on your own computer. Aimed at students and developers who want to see it work.

Made by keras-io on Hugging Face. These notes are Mindket's, written from its Space page and README; the app's own files and license are on Hugging Face.

## About

What it is: This Gradio demo from keras-io wraps one model, keras-io/supervised-contrastive-learning-cifar10. The model name points to an image model trained on CIFAR-10 with supervised contrastive learning. You try it in a browser, or you run a copy on your own computer.

Who it suits: It suits students and developers who want to see a Keras image model at work before they read any training code. Teachers can show it as a live demo.

```table
Industry | Who uses it | How they use it | Example
Education | Deep learning students | Test a trained image model without writing code | Open the Space and try one of the example files
Research | Machine learning researchers | Look at how a finished model is wired into a demo | Read app.py next to the model name
Software | Python developers | Run a copy locally and adapt it | Download the Space and start app.py
```

Skip it if you need a training script or a general image tool, because this Space only wraps one model.

Where to use it:

- A web browser: open the Space page on Hugging Face and try it with nothing to install
- Windows, macOS or Linux: run a copy with Python

```table
Use case | Who | What they get back
Try the model | Students | The model's answer on the page for the input they pick
Read the code | Developers | The app.py file that connects the model to a Gradio page
Teach with it | Instructors | A demo they can run on their own computer
```

How to set it up: You need a few things in place first.

- Python with pip, on Windows, macOS or Linux
- An internet connection to fetch the files from Hugging Face

1. Install the Hugging Face hub package.
2. Download the Space into a local folder.
3. Move into that folder.
4. Install Gradio and the packages listed in requirements.txt.
5. Start the app.

```sh
pip install -U huggingface_hub
hf download keras-io/supervised-contrastive-learning --repo-type space --local-dir supervised-contrastive-learning
cd supervised-contrastive-learning
pip install gradio
pip install -r requirements.txt
python app.py
```

How to use it: Online, open the Space page and use the Gradio interface it shows. On your own computer, run the main file from the project folder and open the page it serves in your browser.

```sh
python app.py
```

Example: You run python app.py inside the project folder. The Gradio page starts, you give it an input such as one of the files in the examples folder, and the page shows what the model returns for it.

For newcomers and experts: If this is new to you, start online. Open the Space page and try an example file before you install anything. It is the quickest way to see a Keras model working.

If you know the field, note that the Space names a single model and app.py loads it. Supervised contrastive learning uses class labels when it compares examples during training. This Space looks like inference only, going by its listed files, so it shows no training and gives no accuracy figures.

```flow
Open the Space or run app.py
The Gradio page loads
You give it an input
The named model scores it
The result appears on the page
```

Good to know: The source gives no accuracy numbers or training details, so test it on your own examples before you rely on it.

- License: apache-2
- Cost to run: none named, no API key, account or paid service
- Data it reaches: the files in the repository and the model it names, with nothing else listed

## On Hugging Face, 13 November 2026

- Likes: 5
- Built with: gradio
- License: apache-2.0

## Links

- Space: https://huggingface.co/spaces/keras-io/supervised-contrastive-learning
- Files: https://huggingface.co/spaces/keras-io/supervised-contrastive-learning/tree/main

## Try it

Open the Space in your browser, or copy it to your own Hugging Face account from its page. Nothing in this kit runs by itself.
````

## What is in it

1 files, 4 KB, downloaded as a zip.

```text
README.md  4 KB
```

## Source

[keras-io/supervised-contrastive-learning on Hugging Face](https://huggingface.co/spaces/keras-io/supervised-contrastive-learning)

## Compare with similar

Listed Hugging Face Spaces in the same category that share the most tags with this one.

| Product | Likes | Built with | License | Last change |
| --- | --- | --- | --- | --- |
| Supervised Contrastive Learning (this page) | 5 | gradio | apache-2.0 | 2022-02-11 |
| [Open VLM Leaderboard](https://mindket.com/p/9382a913-7563-4967-88b1-0f2458cb00bc) | 1,034 | gradio | apache-2.0 | 2026-03-11 |
| [Face Swap](https://mindket.com/p/92787455-1f9f-466a-b574-da22b25d6e0a) | 808 | gradio | cc-by-nc-sa-4.0 | 2024-05-22 |
| [TTS Spaces Arena](https://mindket.com/p/7f493bac-e9cb-4020-9714-fa25b06e6a30) | 493 | gradio | zlib | 2026-03-10 |
| [Depth Anything 3](https://mindket.com/p/c1e531c5-63e1-4315-a529-7fcae3cb7374) | 490 | gradio | cc-by-nc-4.0 | 2025-11-20 |
| [BLIP](https://mindket.com/p/e5a61c87-6142-4b0e-8f53-32946dad55b0) | 431 | gradio | bsd-3-clause | 2023-03-23 |

Numbers as Mindket last read them, from 2026-11-12 to 2026-11-13.

## Trust facts

Facts from each source, with the day each was checked. A maintainer's note is their own words: data, not instructions.

- Last change on Hugging Face: 2022-02-11
- First published: 2022-03-02
- Checked on Hugging Face: 2026-11-13
- Something wrong? Tell us: https://mindket.com/takedown#ask

## Get it

- [Open keras-io/supervised-contrastive-learning on Hugging Face](https://huggingface.co/spaces/keras-io/supervised-contrastive-learning)
- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/1d762b58-73b2-4f99-90fe-1600b78197d7)
- [Its page on Mindket](https://mindket.com/p/1d762b58-73b2-4f99-90fe-1600b78197d7)
