Spaces:
Sleeping
Sleeping
File size: 5,272 Bytes
be5c319 |
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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
#!/bin/bash
# Download Sample Images Script
# This script downloads free sample images from Unsplash for testing
echo "πΌοΈ Downloading sample images for ViT Auditing Toolkit..."
echo ""
# Create directories if they don't exist
mkdir -p examples/{basic_explainability,counterfactual,calibration,bias_detection,general}
# Function to download image with progress
download_image() {
local url=$1
local output=$2
local description=$3
echo "π₯ Downloading: $description"
curl -L "$url" -o "$output" --progress-bar
if [ $? -eq 0 ]; then
echo "β
Saved to: $output"
else
echo "β Failed to download: $description"
fi
echo ""
}
echo "=== Basic Explainability Images ==="
echo ""
# Cat portrait
download_image \
"https://images.unsplash.com/photo-1574158622682-e40e69881006?w=800&q=80" \
"examples/basic_explainability/cat_portrait.jpg" \
"Cat Portrait"
# Dog portrait
download_image \
"https://images.unsplash.com/photo-1543466835-00a7907e9de1?w=800&q=80" \
"examples/basic_explainability/dog_portrait.jpg" \
"Dog Portrait"
# Bird in flight
download_image \
"https://images.unsplash.com/photo-1444464666168-49d633b86797?w=800&q=80" \
"examples/basic_explainability/bird_flying.jpg" \
"Bird Flying"
# Sports car
download_image \
"https://images.unsplash.com/photo-1583121274602-3e2820c69888?w=800&q=80" \
"examples/basic_explainability/sports_car.jpg" \
"Sports Car"
# Coffee cup
download_image \
"https://images.unsplash.com/photo-1509042239860-f550ce710b93?w=800&q=80" \
"examples/basic_explainability/coffee_cup.jpg" \
"Coffee Cup"
echo "=== Counterfactual Analysis Images ==="
echo ""
# Face centered
download_image \
"https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=800&q=80" \
"examples/counterfactual/face_portrait.jpg" \
"Face Portrait (for patch analysis)"
# Car side view
download_image \
"https://images.unsplash.com/photo-1552519507-da3b142c6e3d?w=800&q=80" \
"examples/counterfactual/car_side.jpg" \
"Car Side View"
# Building architecture
download_image \
"https://images.unsplash.com/photo-1480714378408-67cf0d13bc1b?w=800&q=80" \
"examples/counterfactual/building.jpg" \
"Building Architecture"
# Simple object - flower
download_image \
"https://images.unsplash.com/photo-1490750967868-88aa4486c946?w=800&q=80" \
"examples/counterfactual/flower.jpg" \
"Flower (simple object)"
echo "=== Calibration Test Images ==="
echo ""
# High quality clear image
download_image \
"https://images.unsplash.com/photo-1583511655857-d19b40a7a54e?w=800&q=80" \
"examples/calibration/clear_panda.jpg" \
"Clear High-Quality Image"
# Slightly challenging
download_image \
"https://images.unsplash.com/photo-1425082661705-1834bfd09dca?w=800&q=80" \
"examples/calibration/outdoor_scene.jpg" \
"Outdoor Scene (medium difficulty)"
# Complex scene
download_image \
"https://images.unsplash.com/photo-1519389950473-47ba0277781c?w=800&q=80" \
"examples/calibration/workspace.jpg" \
"Complex Workspace Scene"
echo "=== Bias Detection Images ==="
echo ""
# Day lighting
download_image \
"https://images.unsplash.com/photo-1601758228041-f3b2795255f1?w=800&q=80" \
"examples/bias_detection/dog_daylight.jpg" \
"Dog in Daylight"
# Indoor lighting
download_image \
"https://images.unsplash.com/photo-1596492784531-6e6eb5ea9993?w=800&q=80" \
"examples/bias_detection/cat_indoor.jpg" \
"Cat Indoors"
# Outdoor scene
download_image \
"https://images.unsplash.com/photo-1530595467537-0b5996c41f2d?w=800&q=80" \
"examples/bias_detection/bird_outdoor.jpg" \
"Bird Outdoors"
# Urban environment
download_image \
"https://images.unsplash.com/photo-1449844908441-8829872d2607?w=800&q=80" \
"examples/bias_detection/urban_scene.jpg" \
"Urban Environment"
echo "=== General Test Images ==="
echo ""
# Food
download_image \
"https://images.unsplash.com/photo-1565299624946-b28f40a0ae38?w=800&q=80" \
"examples/general/pizza.jpg" \
"Pizza"
# Nature
download_image \
"https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800&q=80" \
"examples/general/mountain.jpg" \
"Mountain Landscape"
# Technology
download_image \
"https://images.unsplash.com/photo-1593642632823-8f785ba67e45?w=800&q=80" \
"examples/general/laptop.jpg" \
"Laptop"
# Furniture
download_image \
"https://images.unsplash.com/photo-1555041469-a586c61ea9bc?w=800&q=80" \
"examples/general/chair.jpg" \
"Modern Chair"
echo ""
echo "======================================"
echo "β
Download complete!"
echo "======================================"
echo ""
echo "π Summary:"
echo " - Basic Explainability: $(ls examples/basic_explainability/*.jpg 2>/dev/null | wc -l) images"
echo " - Counterfactual: $(ls examples/counterfactual/*.jpg 2>/dev/null | wc -l) images"
echo " - Calibration: $(ls examples/calibration/*.jpg 2>/dev/null | wc -l) images"
echo " - Bias Detection: $(ls examples/bias_detection/*.jpg 2>/dev/null | wc -l) images"
echo " - General: $(ls examples/general/*.jpg 2>/dev/null | wc -l) images"
echo ""
echo "π Ready to test! Run: python app.py"
echo ""
|