Spaces:
Sleeping
Sleeping
Delete app.py
Browse files
app.py
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
import numpy as np
|
3 |
-
import pandas as pd
|
4 |
-
import tensorflow as tf
|
5 |
-
from tensorflow.keras.models import load_model
|
6 |
-
from PIL import Image
|
7 |
-
import os
|
8 |
-
|
9 |
-
# Modelin yolu
|
10 |
-
MODEL_PATH = r'C:\Users\devop\OneDrive\Masaüstü\Become apro\TGS - Segmentation Models + Albumentations/my_model.h5' # Model dosyasının yolu
|
11 |
-
model = load_model(MODEL_PATH, compile=False)
|
12 |
-
|
13 |
-
# Uygulamanın başlığı
|
14 |
-
st.title("TGS Tuz Tanımlama Uygulaması")
|
15 |
-
|
16 |
-
# Görüntü yükleme
|
17 |
-
uploaded_file = st.file_uploader("Bir görüntü yükleyin", type=["png", "jpg", "jpeg"])
|
18 |
-
|
19 |
-
if uploaded_file is not None:
|
20 |
-
# Yüklenen görüntüyü oku
|
21 |
-
image = Image.open(uploaded_file).convert("L") # Gri tonlamaya çevir
|
22 |
-
st.image(image, caption='Yüklenen Görüntü', use_column_width=True)
|
23 |
-
|
24 |
-
# Görüntüyü modelin beklediği boyutlara getir
|
25 |
-
image = image.resize((128, 128)) # Hedef boyut
|
26 |
-
image_array = np.array(image) / 255.0 # Normalize et
|
27 |
-
image_array = np.expand_dims(image_array, axis=0) # Boyutunu genişlet
|
28 |
-
|
29 |
-
# Tahmin yap
|
30 |
-
if st.button("Tahmin Et"):
|
31 |
-
prediction = model.predict(image_array)
|
32 |
-
prediction = (prediction > 0.5).astype(np.uint8) # Eşikleme
|
33 |
-
st.image(prediction[0].squeeze(), caption='Tahmin Sonucu', use_column_width=True)
|
34 |
-
|
35 |
-
# Kullanıcı için bilgi
|
36 |
-
st.write("Bu uygulama, yeraltı hedefinin tuz olup olmadığını belirlemek için eğitilmiş bir model kullanır.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|