<!DOCTYPE html “Hello Karim” “https://karim11.shinyapps.io/Karim11”> Effets divers en Javascript

Earth quake dataset

lat : Latitude of event

long : Longitude

mag : Richter Magnitude

depth : Depth (km)

head(quakes, 5)
##      lat   long depth mag stations
## 1 -20.42 181.62   562 4.8       41
## 2 -20.62 181.03   650 4.2       15
## 3 -26.00 184.10    42 5.4       43
## 4 -17.97 181.66   626 4.1       19
## 5 -20.42 181.96   649 4.0       11

Data Visualization : Earth Quake with mag > 5.5

quakes1 <- quakes %>% filter(mag>5.5)
leaflet(data = quakes1) %>% addTiles() %>%
addMarkers(~long, ~lat, popup = ~as.character(mag))
pal <- colorFactor(palette = c("green","yellow","red" ),domain = quakes1$mag)

IMAGE PREDICTION

DOG prediction




def classify(file_path):
    global label_packed
    image = Image.open(file_path)
    image = image.resize((128, 128))
    image = numpy.expand_dims(image, axis=0)
    image = numpy.array(image)
    image = image/255
    pred = model.predict_classes([image])[0]
    sign = classes[pred]
    return sign 
    
    

def load_image(image_path):
    image = Image.open(image_path).convert('RGB')
    image = image.resize([224, 224], Image.LANCZOS)
    return image
library(imager)
f="C:/Users/Administrateur/Desktop/Classification image/cl/test1/10963.jpg"


dog = load.image(f)
plot(dog)

f="C:/Users/Administrateur/Desktop/Classification image/cl/test1/10963.jpg"
classify(f)
## 'Hi Karim, I think, DOG'
## 
## C:\Users\ADMINI~1\Desktop\TRANSO~1\venv\lib\site-packages\keras\engine\sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`,   if your model does multi-class classification   (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`,   if your model does binary classification   (e.g. if it uses a `sigmoid` last-layer activation).
##   warnings.warn('`model.predict_classes()` is deprecated and '

TRAIN prediction

library(imager)

f='C:/Users/Administrateur/Desktop/im/train.jpeg'

train = load.image(f)
plot(train)

mm=tf.keras.preprocessing.image.load_img('C:/Users/Administrateur/Desktop/im/train.jpeg',target_size=(224, 224))
x = image.img_to_array(mm)
x = np.expand_dims(x, axis=0)
x = preprocess_input(x)
pred = model.predict(x)
# print("pridict(classe/%):"    )
## Hi Karim I think locomotive électrique