djai.model.models.ml.hugging_face.object_detection module¶
DjAI Pre-Trained Hugging Face Object Detector Model class.
- class djai.model.models.ml.hugging_face.object_detection.PreTrainedHuggingFaceObjectDetector(*args, **kwargs)[source]¶
Bases:
djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer
DjAI Pre-Trained Hugging Face Object Detector Model class.
- exception DoesNotExist¶
Bases:
djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.DoesNotExist
- exception MultipleObjectsReturned¶
Bases:
djai.model.models.ml.hugging_face.base.PreTrainedHuggingFaceTransformer.MultipleObjectsReturned
- gradio_ui = Gradio Interface for: _predict ------------------------------ inputs: |-Image(label="Upload an Image to Detect Objects") |-Slider(label="Confidence Threshold") outputs: |-Image(label="Detected Objects") |-JSON(label="Detected Objects")¶
- polymorphic_primary_key_name = 'uuid'¶
- polymorphic_super_sub_accessors_replaced = False¶
- predict(image_or_images: Union[str, PIL.Image.Image, collections.abc.Sequence[Union[str, PIL.Image.Image]]], threshold: float = 0.9) Union[List[dict], collections.abc.Sequence[List[dict]]] [source]¶
Detect Objects from Image(s).
- pretrainedhuggingfacetransformer_ptr¶
Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
- pretrainedhuggingfacetransformer_ptr_id¶