commited on
Commit
f7f6ab2
·
verified ·
1 Parent(s): d56ea24

Upload 4 files

Browse files
Files changed (4) hide show
  1. README.md +15 -20
  2. app.py +28 -0
  3. cactus_model.h5 +3 -0
  4. requirements.txt +4 -3
README.md CHANGED
@@ -1,20 +1,15 @@
1
- ---
2
- title: Cactus Identification
3
- emoji: 🚀
4
- colorFrom: red
5
- colorTo: red
6
- sdk: docker
7
- app_port: 8501
8
- tags:
9
- - streamlit
10
- pinned: false
11
- short_description: Streamlit template space
12
- license: mit
13
- ---
14
-
15
- # Welcome to Streamlit!
16
-
17
- Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
18
-
19
- If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
20
- forums](https://discuss.streamlit.io).
 
1
+ # 🌵 Aerial Cactus Identification - Streamlit App
2
+
3
+ Bu uygulama, Kaggle'daki **Aerial Cactus Identification** yarışması için geliştirilmiş bir görüntü sınıflandırma modeline dayanmaktadır.
4
+
5
+ ## Özellikler
6
+ - CNN ile 32x32 px görüntülerde kaktüs tespiti
7
+ - Streamlit ile etkileşimli görsel yükleme ve tahmin
8
+ - HuggingFace veya lokal çalıştırma desteği
9
+
10
+ ## Kullanım
11
+ 1. `cactus_model.h5` dosyasını aynı klasöre koyun.
12
+ 2. Terminalde çalıştırın:
13
+
14
+ ```bash
15
+ streamlit run app.py
 
 
 
 
 
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import numpy as np
3
+ import cv2
4
+ from PIL import Image
5
+ from tensorflow.keras.models import load_model
6
+
7
+ st.title("🌵 Kaktüs Tanıma Uygulaması")
8
+ st.write("Yüklediğiniz hava fotoğrafında kaktüs olup olmadığını tahmin ediyoruz.")
9
+
10
+ # Modeli yükle
11
+ model = load_model("cactus_model.h5")
12
+
13
+ # Görsel yükleme
14
+ uploaded_file = st.file_uploader("Bir fotoğraf yükleyin (32x32 px olacak şekilde küçültülecek)", type=["jpg", "png"])
15
+
16
+ if uploaded_file is not None:
17
+ image = Image.open(uploaded_file).convert("RGB")
18
+ st.image(image, caption="Yüklenen Görsel", use_column_width=True)
19
+
20
+ # Görseli uygun boyuta getir
21
+ img = np.array(image.resize((32, 32))) / 255.0
22
+ img = np.expand_dims(img, axis=0)
23
+
24
+ # Tahmin yap
25
+ prediction = model.predict(img)
26
+ result = np.argmax(prediction)
27
+
28
+ st.write("📢 Tahmin:", "Kaktüs VAR 🌵" if result == 1 else "Kaktüs YOK 🏜️")
cactus_model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fafc7acd7d177b3e2f807a125dd068bbd5a13ed6c0283d1cdd20e768cebfc1ad
3
+ size 2045040
requirements.txt CHANGED
@@ -1,3 +1,4 @@
1
- altair
2
- pandas
3
- streamlit
 
 
1
+ streamlit
2
+ tensorflow
3
+ opencv-python
4
+ pillow