Skip to content

Commit

Permalink
rearrange improts for module alexnet
Browse files Browse the repository at this point in the history
  • Loading branch information
eljanmahammadli committed Nov 20, 2023
1 parent 00ef4cd commit 286daca
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions examples/alexnet.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import os
import requests
import argparse
import os, requests, argparse
from typing import Sequence
from PIL import Image
import requests
from io import BytesIO
import numpy as np
import matplotlib.pyplot as plt
import torch
from torchvision import models, transforms
from gradipy.tensor import Tensor
import gradipy.nn as nn
from .imagenet import IMAGENET_CATEGORIES
from typing import Sequence


class AlexNet(nn.Module):
Expand Down Expand Up @@ -96,8 +92,6 @@ def load_and_preprocess_image(url):
)
response = requests.get(url)
img = Image.open(BytesIO(response.content))
# plt.imshow(img)
# plt.show()
img = preprocess(img)
img = img.unsqueeze(0) # Add batch dimension
return img
Expand Down

0 comments on commit 286daca

Please sign in to comment.