class_docstr: This is the image classification class in the ImageAI library. It allows you to classify objects into all the 1000 different classes in the ImageNet dataset [ https://www.kaggle.com/c/imagenet-object-localization-challenge/overview/description ].
  
  The class provides 4 different classification models which are ResNet50, DensesNet121, InceptionV3 and MobileNetV2.
  
  The following functions are required to be called before a classification can be made
  
  * At least of of the following and it must correspond to the model set in the setModelPath()
  [setModelTypeAsMobileNetV2(), setModelTypeAsResNet(), setModelTypeAsDenseNet, setModelTypeAsInceptionV3]
  
  * setModelPath: This is used to specify the absolute path to a pretrained model file. Download any of the files in this release -> https://github.com/OlafenwaMoses/ImageAI/releases/tag/3.0.0-pretrained
  
  * useCPU (Optional): If you will like to force the image classification to be performed on CPU, call this function.
  
  * loadModel: Used to load the pretrained model weights
  
  * classifyImage(): Used for classifying an image.
docstr: Used to force classification to be done on CPU.
  By default, classification will occur on GPU compute if available else CPU compute.
docstr_tok: ["Used","to","force","classification","to","be","done","on","CPU",".","By","default",",","classification","will","occur","on","GPU","compute","if","available","else","CPU","compute","."]
code: def useCPU(self):
      """
      Used to force classification to be done on CPU.
      By default, classification will occur on GPU compute if available else CPU compute.
      """
      self.__device = "cpu"
      if self.__model_loaded:
          self.__model_loaded = False
          self.loadModel()
  
imports: import os, re
  from typing import Union
  from typing import List, Tuple
  import numpy
  import torch
  from torchvision.models import resnet50, densenet121, mobilenet_v2, inception_v3
  import torch.nn.functional
  from torchvision import transforms
  from PIL import Image
  import traceback
  from ..backend_check.model_extension import extension_check
label_desc: Use image node_id 9 for calling the ImageClassification obj's underlying member method code with example usage: obj.useCPU() without return types