(20241010) Almost ready for deployment.

This commit is contained in:
2024-10-10 11:44:45 +05:30
13 changed files with 87 additions and 23 deletions
@@ -11,7 +11,7 @@
OBJECTIVE:
To provide an easy way to assess images for blurriness.
Tried and implemented using HuggingFace models.
Tried and implemented using HuggingFace behaviour_models.
REFERENCES:
@@ -193,7 +193,7 @@ if __name__ == "__main__":
async def main():
image = r"/home/developer/Downloads/low-res-check.png"
assessor = AssessImageBlur(model = r"/home/developer/PycharmProjects/utils/data/ai/models/hugging_face/image_classification/BlurOrBokeh")
assessor = AssessImageBlur(model = r"/home/developer/PycharmProjects/utils/data/ai/behaviour_models/hugging_face/image_classification/BlurOrBokeh")
usable = await assessor.is_ok(image)
classes = await assessor.classify(image)
print("IS OKAY:", usable)
@@ -11,7 +11,7 @@
OBJECTIVE:
To provide an easy way to assess images for adult content.
Tried and implemented using HuggingFace models.
Tried and implemented using HuggingFace behaviour_models.
REFERENCES:
@@ -13,12 +13,12 @@
To provide an easy way to get masks from dichotomous image segmentation.
This code uses a very specific model from HuggingFace: "ZhengPeng7/BiRefNet-portrait".
You may experiment with other models too, but make sure that model is made for "dichotomous" behaviour. This
You may experiment with other behaviour_models too, but make sure that model is made for "dichotomous" behaviour. This
means that the model should have only two classes like "foreground", and "background". The specified model was
trained for implementing portrait mode style blurring of backgrounds.
The originally tested model has an MIT license as per their GitHub page. The code in this file may or may not
support drop-in replacement for other models, please be aware about this.
support drop-in replacement for other behaviour_models, please be aware about this.
REFERENCES:
+2 -2
View File
@@ -10,7 +10,7 @@
OBJECTIVE:
To provide a class to detect objects in images using YOLO models.
To provide a class to detect objects in images using YOLO behaviour_models.
REFERENCES:
@@ -166,7 +166,7 @@ class YoloDetect:
if __name__ == "__main__":
# model_file_path = os.path.join(constants.PROJECT_DIRECTORY, "ai", "yolo", "models", "yolov8x.pt")
# model_file_path = os.path.join(constants.PROJECT_DIRECTORY, "ai", "yolo", "behaviour_models", "yolov8x.pt")
model_file_path = r"/home/developer/PycharmProjects/utils/data/ai/models/hugging_face/object_detection/YOLOv10-Document-Layout-Analysis/yolov10x_best.pt"
# sample_image_path = r"/home/developer/Downloads/2_cats.jpg"
sample_image_path = r"/home/developer/Downloads/flattened_image.jpg"