<jupyter_start><jupyter_text>HRNet Timm<jupyter_code>%load_ext autoreload
%autoreload 2

import torch
import timm

from timm.data.dataset import ImageDataset

import torchvision.datasets as D
import torchvision.transforms.functional as TF

import numpy as np
import matplotlib.pyplot as plt
timm.list_models("*HRNet*", pretrained=True)
hrmodel = timm.create_model("hrnet_w18", pretrained=True)
hrmodel.eval()

hrmodel.reset_classifier(30)
dataset = D.Cityscapes('HRNet/data/cityscapes', split="val", target_type='semantic')
fig,ax = plt.subplots(ncols=2, figsize=(12,8))
ax[0].imshow(dataset[0][0])
ax[1].imshow(dataset[0][1], cmap='gray')
test = torch.Tensor(np.array([np.array(dataset[0][0])]))
test = torch.permute(test, (0, 3, 1, 2))
y = hrmodel(test)
y[0].argmax()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15519399249061328, 'fraction_numerical': 0.02753441802252816, 'mean_word_length': 7.98876404494382, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '549821', 'license': 'Net-SNMP', 'n_tokens_mistral': 317, 'n_tokens_neox': 314, 'n_words': 57, 'path': 'sota_model/exploration_notebooks/HRNet.ipynb', 'repo_name': 'Luminilion/Visual-Intelligence---Benchmarking-Framework-for-Bad-Weather-Distortion', 'size': '799'}