This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module = hub.Module(name = "ace2p") | |
res = module.segmentation(paths = ["img1.jpg"], visualization = True, output_dir = 'ace2p_output') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module = hub.Module(name="humanseg_lite", version = "1.1.1") | |
res = module.segment(paths = ["img1.jpg"], visualization = True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module = hub.Module(name="openpose_body_estimation") | |
res = module.predict( img = "img1.jpg", visualization = True, save_path = 'New') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module = hub.Module(name="ultra_light_fast_generic_face_detector_1mb_640") | |
res = module.face_detection(paths = ["img1.jpg"], visualization = True, output_dir = 'DETECTED') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import paddlehub as hub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!pip install --upgrade paddlepaddle | |
!pip install --upgrade paddlehub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# save the model | |
model.save("Intent_Classification.h5") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sentence = "An Artist released a new music album " | |
tokens = Tokenizer.texts_to_sequences([sentence]) | |
tokens = pad_sequences(tokens, maxlen = 6000) | |
prediction = model.predict(np.array(tokens)) | |
pred = np.argmax(prediction) | |
classes = ['BookRestaurant','GetWeather','PlayMusic','RateBook'] | |
classes[pred] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sentence = "this novel deserves a rating of 10" | |
tokens = Tokenizer.texts_to_sequences([sentence]) | |
tokens = pad_sequences(tokens, maxlen = 6000) | |
prediction = model.predict(np.array(tokens)) | |
pred = np.argmax(prediction) | |
classes = ['BookRestaurant','GetWeather','PlayMusic','RateBook'] | |
classes[pred] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sentence = "is it raining ?" | |
tokens = Tokenizer.texts_to_sequences([sentence]) | |
tokens = pad_sequences(tokens, maxlen = 6000) | |
prediction = model.predict(np.array(tokens)) | |
pred = np.argmax(prediction) | |
classes = ['BookRestaurant','GetWeather','PlayMusic','RateBook'] | |
classes[pred] |