File size: 2,268 Bytes
ca2775c
 
 
 
 
487e6a0
ca2775c
 
 
 
07219c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---

title: Tutorial Hackathon
emoji: 🚀
colorFrom: blue
colorTo: red
sdk: streamlit
app_file: app.py
pinned: false
---


# Image Subject Comparison Tutorial

This is a Streamlit-based web application for a tutorial on determining if two images depict the same subject. It presents 8 scenarios based on specific rules, allowing users to select a scenario, view placeholder images, and choose "Yes" or "No" to receive feedback.

## Features

- **Interactive Scenarios**: Select from 8 predefined scenarios.
- **Image Display**: View two images side-by-side for each scenario.
- **Feedback System**: Click "Yes" or "No" to get instant feedback on correctness.
- **Tutorial Rules**: Based on rules for same-subject comparison (e.g., same person vs. associated items).

## Scenarios

1. **Different pictures of the same person** - Yes
2. **Identical or resized picture** - Yes
3. **Different pictures of the same landmark** - Yes
4. **Subject vs. representation (e.g., landmark vs. keychain)** - No
5. **Person vs. associated item (e.g., player vs. jersey)** - No
6. **Person vs. their signature** - No
7. **Person vs. their tombstone** - No
8. **Same person at different ages** - Yes

## Installation

1. Clone or download the repository.
2. Install dependencies:
   ```

   pip install -r requirements.txt

   ```

## Running Locally

1. Ensure you have Python installed.
2. Run the Streamlit app:
   ```

   streamlit run app.py

   ```
3. Open the provided local URL in your browser (usually `http://localhost:8501`).

## Hosting on Hugging Face Spaces

1. Go to [Hugging Face Spaces](https://huggingface.co/spaces).
2. Create a new Space.
3. Select "Streamlit" as the SDK.
4. Upload `app.py` and `requirements.txt`.
5. The app will be hosted and accessible via the Space's URL.

## Usage

- Select a scenario from the dropdown.
- View the two images.
- Click "Yes" or "No" to see if your answer is correct and read the feedback.

## Customization

- **Images**: Replace placeholder URLs in `app.py` with actual Wikimedia Commons image links.
- **Scenarios**: Modify the `scenarios` list in `app.py` to add or change scenarios.

## Dependencies

- streamlit

## License

[Add license if applicable]