Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Develop an Image Classification with subclasses for dogs and cats (e.g., dog, cat -> siberian dog, persian cat) [closed]

$
0
0

I just tried Image Classification with Python TensorFlow Keras but for only one class and it worked. And now i wonder if this could also be upgraded into subclass classification. So, let's say I've classified for dogs and cats, and now I wanna improve the classification so that I can classify based on its races like Siberian Dog and Persian Cat)

Here are the imports that I used for single-class Image Classification:

from tensorflow.keras.models import Sequentialfrom tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Densefrom tensorflow.keras.preprocessing.image import ImageDataGenerator

And then I use Sequential Model like this:

model = models.Sequential()model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(img_height, img_width, 3)))model.add(layers.MaxPooling2D((2, 2)))model.add(layers.Conv2D(64, (3, 3), activation='relu'))model.add(layers.MaxPooling2D((2, 2)))model.add(layers.Conv2D(128, (3, 3), activation='relu'))model.add(layers.MaxPooling2D((2, 2)))model.add(layers.Flatten())model.add(layers.Dense(128, activation='relu'))model.add(layers.Dense(num_classes, activation='softmax'))

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>