Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 1.13 KB

File metadata and controls

33 lines (27 loc) · 1.13 KB

Multi-Dimension Model Training in PyTorch

Dataset

In this project, model build for multi dimension images like image dimension >3(rgb). so data created in such a manner where images are random 8 dimension images with their respective random labels.

   self.image = np.random.rand(5000,224,224,8)
   self.labels = np.random.choice([0, 1], size=(5000,), p=[0.6,0.4])

Image classification using pretrained model on random multi dimension image data

Below are the prettrained model used for this problem:

  1. resnet18
  2. vgg16
  3. densenet161
  4. alexnet

If train the model for 3-dimensional image then change input_dim = 3

prediction

import torch
from utils.utils import *
x,y = dataset
model = torch.load('model_multi_dim.pth')
y_pred = model(x)
accuracy = binary_acc(y_pred,y)

Give a ⭐ To This Repository!