Spaces:
Runtime error
Runtime error
Commit ·
2a75de9
1
Parent(s): c4278c2
Update custom_resnet.py
Browse files- custom_resnet.py +15 -0
custom_resnet.py
CHANGED
|
@@ -1,4 +1,19 @@
|
|
| 1 |
from pytorch_lightning import LightningModule, Trainer, seed_everything
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
class LitResnet(LightningModule):
|
| 4 |
def __init__(self, lr=0.01, drop= 0.05, norm='BN',groupsize=1):
|
|
|
|
| 1 |
from pytorch_lightning import LightningModule, Trainer, seed_everything
|
| 2 |
+
import torch
|
| 3 |
+
import pandas as pd
|
| 4 |
+
import numpy as np
|
| 5 |
+
import gradio as gr
|
| 6 |
+
from PIL import Image
|
| 7 |
+
from torch.nn import functional as F
|
| 8 |
+
from collections import OrderedDict
|
| 9 |
+
from torchvision import transforms
|
| 10 |
+
from pytorch_grad_cam import GradCAM
|
| 11 |
+
from pytorch_grad_cam.utils.image import show_cam_on_image
|
| 12 |
+
from pytorch_grad_cam.utils.model_targets import ClassifierOutputTarget
|
| 13 |
+
from pytorch_lightning import LightningModule, Trainer, seed_everything
|
| 14 |
+
import albumentations as A
|
| 15 |
+
from albumentations.pytorch import ToTensorV2
|
| 16 |
+
import torchvision.transforms as T
|
| 17 |
|
| 18 |
class LitResnet(LightningModule):
|
| 19 |
def __init__(self, lr=0.01, drop= 0.05, norm='BN',groupsize=1):
|