İmage Processing de dataset ile nesne tanima
6
●66
- 24-01-2023, 03:11:33Merhabalar, image processing projemde verilen dataseti train edip girilen resmin ne oldugunu tahmin etmesini saglamaliyim. Çok uzun arastirma yapmama ragmen hala bu konu hakkinda bilgi sahibi olamadim
- 24-01-2023, 03:13:46python kütüphanelerine bak hocam konu hakkında sayısız örnek var.
- 24-01-2023, 03:14:33opyan adlı üyeden alıntı: mesajı görüntüle
- 24-01-2023, 03:27:04yunusemre34 adlı üyeden alıntı: mesajı görüntüle
- 24-01-2023, 03:28:44Pythonda birçok kütüphaneyi kullanarak sağlayabilirsiniz.
Örnek kod ;
import numpy as np import keras from keras.datasets import cifar10 from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D from keras.optimizers import RMSprop from keras.utils import to_categorical # Step 1: Load the dataset (x_train, y_train), (x_test, y_test) = cifar10.load_data() # Step 2: Preprocess the data x_train = x_train.astype('float32') x_test = x_test.astype('float32') x_train /= 255 x_test /= 255 y_train = to_categorical(y_train, 10) y_test = to_categorical(y_test, 10) # Step 3: Create the model model = Sequential() model.add(Conv2D(32, kernel_size=(3, 3), activation='relu', input_shape=(32, 32, 3))) model.add(MaxPooling2D(pool_size=(2, 2))) model.add(Flatten()) model.add(Dense(10, activation='softmax')) # Step 4: Compile the model model.compile(loss='categorical_crossentropy', optimizer=RMSprop(), metrics=['accuracy']) # Step 5: Train the model model.fit(x_train, y_train, batch_size=32, epochs=10, validation_data=(x_test, y_test)) # Step 6: Test the model on new data new_image = ... # load new image predictions = model.predict(new_image) print(predictions)
projenize göre düzenleyebilirsiniz. - 24-01-2023, 03:40:36ReckRaez adlı üyeden alıntı: mesajı görüntüleopyan adlı üyeden alıntı: mesajı görüntüle