{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "c:\\Users\\mipbk\\anaconda3\\envs\\myenv\\lib\\site-packages\\torchvision\\io\\image.py:13: UserWarning: Failed to load image Python extension: [WinError 127] The specified procedure could not be found\n", " warn(f\"Failed to load image Python extension: {e}\")\n" ] } ], "source": [ "try:\n", " import fastkaggle\n", "except ModuleNotFoundError:\n", " !pip install -Uq fastkaggle\n", "try:\n", " import tqdm\n", "except ModuleNotFoundError:\n", " !pip install tqdm\n", "try:\n", " import pydicom\n", "except ModuleNotFoundError:\n", " !pip install pydicom\n", "\n", "from fastkaggle import *\n", "from fastai.vision.all import *\n", "from fastai.medical.imaging import *\n", "from fastai.data.all import *\n", "from tqdm.notebook import tqdm\n", "import pydicom" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "comp = \"rsna-pneumonia-detection-challenge\"\n", "path = setup_comp(comp, install='fastai \"timm>=0.6.2.dev0\"')" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Classification & Detection" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "train_path = path/\"stage_2_train_images_subset\"\n", "bs = 16\n", "epochs = 1\n", "# arch = 'resnet26d'\n", "arch = 'convnext_tiny_in22k'" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | patientId | \n", "x | \n", "y | \n", "width | \n", "height | \n", "Target | \n", "
---|---|---|---|---|---|---|
0 | \n", "0004cfab-14fd-4e49-80ba-63a80b6bddd6 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "0 | \n", "
1 | \n", "00313ee0-9eaa-42f4-b0ab-c148ed3241cd | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "0 | \n", "
2 | \n", "00322d4d-1c29-4943-afc9-b6754be640eb | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "0 | \n", "
3 | \n", "003d8fa0-6bf1-40ed-b54c-ac657f8495c5 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "0 | \n", "
4 | \n", "00436515-870c-4b36-a041-de91049b9ab4 | \n", "264.0 | \n", "152.0 | \n", "213.0 | \n", "379.0 | \n", "1 | \n", "
5 | \n", "00436515-870c-4b36-a041-de91049b9ab4 | \n", "562.0 | \n", "152.0 | \n", "256.0 | \n", "453.0 | \n", "1 | \n", "