-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #618 from OlafenwaMoses/tensorflow2.0-port
Updated for Tensorflow 2.4.0
- Loading branch information
Showing
163 changed files
with
6,427 additions
and
9,015 deletions.
There are no files selected for viewing
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
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from imageai.Prediction.Custom import ModelTraining | ||
from imageai.Classification.Custom import ClassificationModelTrainer | ||
import os | ||
|
||
trainer = ModelTraining() | ||
trainer.setModelTypeAsDenseNet() | ||
trainer = ClassificationModelTrainer() | ||
trainer.setModelTypeAsDenseNet121() | ||
trainer.setDataDirectory("idenprof") | ||
trainer.trainModel(num_objects=10, num_experiments=50, enhance_data=True, batch_size=8, show_network_summary=True, continue_from_model="idenprof_densenet-0.763500.h5") # Download the model via this link https://github.com/OlafenwaMoses/ImageAI/releases/tag/models-v3 | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
from imageai.Prediction.Custom import CustomImagePrediction | ||
from imageai.Classification.Custom import CustomImageClassification | ||
import os | ||
|
||
execution_path = os.getcwd() | ||
|
||
prediction = CustomImagePrediction() | ||
prediction.setModelTypeAsResNet() | ||
prediction.setModelPath(os.path.join(execution_path, "idenprof_resnet.h5")) # Download the model via this link https://github.com/OlafenwaMoses/ImageAI/releases/tag/models-v3 | ||
prediction = CustomImageClassification() | ||
prediction.setModelTypeAsResNet50() | ||
prediction.setModelPath(os.path.join(execution_path, "idenprof_resnet_ex-056_acc-0.993062.h5")) # Download the model via this link https://github.com/OlafenwaMoses/ImageAI/releases/tag/models-v3 | ||
prediction.setJsonPath(os.path.join(execution_path, "idenprof.json")) | ||
prediction.loadModel(num_objects=10) | ||
|
||
predictions, probabilities = prediction.predictImage(os.path.join(execution_path, "9.jpg"), result_count=5) | ||
predictions, probabilities = prediction.classifyImage(os.path.join(execution_path, "9.jpg"), result_count=5) | ||
|
||
for eachPrediction, eachProbability in zip(predictions, probabilities): | ||
print(eachPrediction , " : " , eachProbability) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from imageai.Prediction.Custom import ModelTraining | ||
from imageai.Classification.Custom import ClassificationModelTrainer | ||
|
||
|
||
model_trainer = ModelTraining() | ||
model_trainer.setModelTypeAsResNet() | ||
model_trainer = ClassificationModelTrainer() | ||
model_trainer.setModelTypeAsResNet50() | ||
model_trainer.setDataDirectory("idenprof") | ||
model_trainer.trainModel(num_objects=10, num_experiments=200, enhance_data=True, batch_size=32, show_network_summary=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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from imageai.Prediction.Custom import ModelTraining | ||
from imageai.Classification.Custom import ClassificationModelTrainer | ||
import os | ||
|
||
trainer = ModelTraining() | ||
trainer.setModelTypeAsResNet() | ||
trainer = ClassificationModelTrainer() | ||
trainer.setModelTypeAsResNet50() | ||
trainer.setDataDirectory("idenprof") | ||
trainer.trainModel(num_objects=10, num_experiments=50, enhance_data=True, batch_size=16, show_network_summary=True,transfer_from_model="resnet50_weights_tf_dim_ordering_tf_kernels.h5", initial_num_objects=1000) # Download the model via this link https://github.com/OlafenwaMoses/ImageAI/releases/tag/models-v3 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
from imageai.Prediction import ImagePrediction | ||
from imageai.Classification import ImageClassification | ||
import os | ||
|
||
execution_path = os.getcwd() | ||
|
||
prediction = ImagePrediction() | ||
prediction.setModelTypeAsResNet() | ||
prediction.setModelPath(os.path.join(execution_path, "resnet50_weights_tf_dim_ordering_tf_kernels.h5")) # Download the model via this link https://github.com/OlafenwaMoses/ImageAI/releases/tag/1.0 | ||
prediction = ImageClassification() | ||
prediction.setModelTypeAsResNet50() | ||
prediction.setModelPath(os.path.join(execution_path, "resnet50_imagenet_tf.2.0.h5")) # Download the model via this link https://github.com/OlafenwaMoses/ImageAI/releases/tag/1.0 | ||
prediction.loadModel() | ||
|
||
predictions, probabilities = prediction.predictImage(os.path.join(execution_path, "1.jpg"), result_count=10) | ||
predictions, probabilities = prediction.classifyImage(os.path.join(execution_path, "1.jpg"), result_count=10) | ||
for eachPrediction, eachProbability in zip(predictions, probabilities): | ||
print(eachPrediction , " : " , eachProbability) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.