Spaces:
Sleeping
Sleeping
Upload cancer-detector-using-gradio (1).ipynb
Browse files
cancer-detector-using-gradio (1).ipynb
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.7.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n for filename in filenames:\n print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-04-28T20:21:26.291595Z","iopub.execute_input":"2023-04-28T20:21:26.292023Z","iopub.status.idle":"2023-04-28T20:21:26.317278Z","shell.execute_reply.started":"2023-04-28T20:21:26.291985Z","shell.execute_reply":"2023-04-28T20:21:26.315920Z"},"trusted":true},"execution_count":3,"outputs":[{"name":"stdout","text":"/kaggle/input/classi/ClassRF (1).pkl\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN141.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN177.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM68.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN136.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN161.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN155.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN133.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM81.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN176.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN168.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN154.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-Melt26.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN172.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM61.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM76.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN163.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM66.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN181.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM63.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN143.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN148.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN164.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM64.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-Melt28.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN145.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN175.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN135.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM71.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN142.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN171.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM65.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN165.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN160.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-Melt21.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN132.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-Melt27.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM79.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN162.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN150.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM82.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN157.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM69.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN131.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN156.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM62.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM74.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM75.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN138.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN180.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM67.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM70.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM77.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-Melt22.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN182.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN153.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM72.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN169.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN151.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN158.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-Melt20.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN139.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN167.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN149.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN146.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM84.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-Melt23.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN184.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM80.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-Melt25.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM78.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN147.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM83.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN152.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-MM73.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN144.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN178.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN173.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN183.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN166.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN137.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN140.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN130.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN170.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-Melt24.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN174.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN179.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN134.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-test/rgb-DN159.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM29.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN124.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM59.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt10.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM41.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM34.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt6.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM6.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM42.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM7.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN98.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN94.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN118.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM12.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM5.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM3.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM25.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN112.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN129.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM16.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM26.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN126.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN123.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM52.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM27.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM11.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM1.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM33.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM56.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt12.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM35.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM20.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM8.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt5.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM51.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt11.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN103.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN104.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM50.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN110.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM39.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN99.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM14.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt13.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt18.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt15.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN108.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN128.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM15.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM10.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM32.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM31.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM38.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM55.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN106.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN100.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN101.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM54.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM47.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM24.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM45.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM43.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN113.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt17.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM19.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM23.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN125.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt19.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM13.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN116.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN127.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM36.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN105.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN122.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM9.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt1.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM53.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN95.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM49.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN119.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN114.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM4.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt4.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN117.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt8.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN107.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM40.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM57.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN115.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN109.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN111.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt3.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt14.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM48.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM22.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM28.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN120.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN97.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM46.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM58.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt16.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM18.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM2.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM30.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt7.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN102.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt2.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN121.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM21.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM37.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM44.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-Melt9.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM17.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-DN96.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-melanoma-train/rgb-MM60.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Lentigo14.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Sebk14.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Nv12.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Sebk12.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Nv15.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Lentigo18.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Nv11.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Lentigo17.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Sebk15.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Nv13.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Lentigo16.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Sebk13.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Lentigo15.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-test/rgb-Nv14.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Nv3.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Sebk2.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Lentigo2.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Nv8.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Sebk7.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Sebk10.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Sebk11.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Lentigo4.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Lentigo13.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Nv9.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Lentigo8.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Lentigo11.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Sebk3.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Nv1.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Lentigo3.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Lentigo1.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Lentigo9.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Lentigo10.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Lentigo12.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Lentigo6.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Sebk4.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Nv5.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Nv4.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Sebk6.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Lentigo7.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Nv7.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Sebk5.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Nv2.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Sebk9.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Nv10.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Sebk8.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Sebk1.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Nv6.jpg\n/kaggle/input/rgb-crop/CROP-RGB/rgb-normal-train/rgb-Lentigo5.jpg\n/kaggle/input/logistic/LRclass.pkl\n/kaggle/input/convmo/Conversion_model.h5\n","output_type":"stream"}]},{"cell_type":"code","source":"pip install gradio==3.14.0","metadata":{"execution":{"iopub.status.busy":"2023-04-28T20:21:32.692713Z","iopub.execute_input":"2023-04-28T20:21:32.693170Z","iopub.status.idle":"2023-04-28T20:21:52.069848Z","shell.execute_reply.started":"2023-04-28T20:21:32.693126Z","shell.execute_reply":"2023-04-28T20:21:52.067992Z"},"trusted":true},"execution_count":4,"outputs":[{"name":"stdout","text":"Collecting gradio==3.14.0\n Downloading gradio-3.14.0-py3-none-any.whl (13.8 MB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m13.8/13.8 MB\u001b[0m \u001b[31m16.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n\u001b[?25hCollecting ffmpy\n Downloading ffmpy-0.3.0.tar.gz (4.8 kB)\n Preparing metadata (setup.py) ... \u001b[?25ldone\n\u001b[?25hRequirement already satisfied: markdown-it-py[linkify,plugins] in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (2.1.0)\nCollecting httpx\n Downloading httpx-0.24.0-py3-none-any.whl (75 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m75.3/75.3 kB\u001b[0m \u001b[31m5.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hRequirement already satisfied: pycryptodome in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (3.17)\nRequirement already satisfied: markupsafe in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (2.1.1)\nRequirement already satisfied: pyyaml in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (6.0)\nRequirement already satisfied: numpy in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (1.21.6)\nRequirement already satisfied: altair in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (4.2.2)\nRequirement already satisfied: fsspec in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (2023.1.0)\nRequirement already satisfied: fastapi in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (0.89.1)\nRequirement already satisfied: websockets>=10.0 in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (11.0)\nCollecting python-multipart\n Downloading python_multipart-0.0.6-py3-none-any.whl (45 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m45.7/45.7 kB\u001b[0m \u001b[31m3.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hRequirement already satisfied: pydantic in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (1.10.4)\nRequirement already satisfied: orjson in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (3.8.5)\nRequirement already satisfied: uvicorn in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (0.20.0)\nRequirement already satisfied: jinja2 in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (3.1.2)\nRequirement already satisfied: aiohttp in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (3.8.3)\nRequirement already satisfied: pydub in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (0.25.1)\nRequirement already satisfied: matplotlib in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (3.5.3)\nRequirement already satisfied: pillow in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (9.4.0)\nRequirement already satisfied: requests in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (2.28.2)\nRequirement already satisfied: pandas in /opt/conda/lib/python3.7/site-packages (from gradio==3.14.0) (1.3.5)\nRequirement already satisfied: charset-normalizer<3.0,>=2.0 in /opt/conda/lib/python3.7/site-packages (from aiohttp->gradio==3.14.0) (2.1.1)\nRequirement already satisfied: asynctest==0.13.0 in /opt/conda/lib/python3.7/site-packages (from aiohttp->gradio==3.14.0) (0.13.0)\nRequirement already satisfied: typing-extensions>=3.7.4 in /opt/conda/lib/python3.7/site-packages (from aiohttp->gradio==3.14.0) (4.4.0)\nRequirement already satisfied: aiosignal>=1.1.2 in /opt/conda/lib/python3.7/site-packages (from aiohttp->gradio==3.14.0) (1.3.1)\nRequirement already satisfied: multidict<7.0,>=4.5 in /opt/conda/lib/python3.7/site-packages (from aiohttp->gradio==3.14.0) (6.0.4)\nRequirement already satisfied: attrs>=17.3.0 in /opt/conda/lib/python3.7/site-packages (from aiohttp->gradio==3.14.0) (22.2.0)\nRequirement already satisfied: yarl<2.0,>=1.0 in /opt/conda/lib/python3.7/site-packages (from aiohttp->gradio==3.14.0) (1.8.2)\nRequirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /opt/conda/lib/python3.7/site-packages (from aiohttp->gradio==3.14.0) (4.0.2)\nRequirement already satisfied: frozenlist>=1.1.1 in /opt/conda/lib/python3.7/site-packages (from aiohttp->gradio==3.14.0) (1.3.3)\nRequirement already satisfied: entrypoints in /opt/conda/lib/python3.7/site-packages (from altair->gradio==3.14.0) (0.4)\nRequirement already satisfied: toolz in /opt/conda/lib/python3.7/site-packages (from altair->gradio==3.14.0) (0.11.2)\nRequirement already satisfied: jsonschema>=3.0 in /opt/conda/lib/python3.7/site-packages (from altair->gradio==3.14.0) (4.17.3)\nRequirement already satisfied: python-dateutil>=2.7.3 in /opt/conda/lib/python3.7/site-packages (from pandas->gradio==3.14.0) (2.8.2)\nRequirement already satisfied: pytz>=2017.3 in /opt/conda/lib/python3.7/site-packages (from pandas->gradio==3.14.0) (2022.7.1)\nRequirement already satisfied: starlette==0.22.0 in /opt/conda/lib/python3.7/site-packages (from fastapi->gradio==3.14.0) (0.22.0)\nRequirement already satisfied: anyio<5,>=3.4.0 in /opt/conda/lib/python3.7/site-packages (from starlette==0.22.0->fastapi->gradio==3.14.0) (3.6.2)\nRequirement already satisfied: sniffio in /opt/conda/lib/python3.7/site-packages (from httpx->gradio==3.14.0) (1.3.0)\nCollecting httpcore<0.18.0,>=0.15.0\n Downloading httpcore-0.17.0-py3-none-any.whl (70 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m70.6/70.6 kB\u001b[0m \u001b[31m5.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hRequirement already satisfied: idna in /opt/conda/lib/python3.7/site-packages (from httpx->gradio==3.14.0) (3.4)\nRequirement already satisfied: certifi in /opt/conda/lib/python3.7/site-packages (from httpx->gradio==3.14.0) (2022.12.7)\nRequirement already satisfied: mdurl~=0.1 in /opt/conda/lib/python3.7/site-packages (from markdown-it-py[linkify,plugins]->gradio==3.14.0) (0.1.2)\nRequirement already satisfied: mdit-py-plugins in /opt/conda/lib/python3.7/site-packages (from markdown-it-py[linkify,plugins]->gradio==3.14.0) (0.3.3)\nCollecting linkify-it-py~=1.0\n Downloading linkify_it_py-1.0.3-py3-none-any.whl (19 kB)\nRequirement already satisfied: cycler>=0.10 in /opt/conda/lib/python3.7/site-packages (from matplotlib->gradio==3.14.0) (0.11.0)\nRequirement already satisfied: packaging>=20.0 in /opt/conda/lib/python3.7/site-packages (from matplotlib->gradio==3.14.0) (23.0)\nRequirement already satisfied: pyparsing>=2.2.1 in /opt/conda/lib/python3.7/site-packages (from matplotlib->gradio==3.14.0) (3.0.9)\nRequirement already satisfied: kiwisolver>=1.0.1 in /opt/conda/lib/python3.7/site-packages (from matplotlib->gradio==3.14.0) (1.4.4)\nRequirement already satisfied: fonttools>=4.22.0 in /opt/conda/lib/python3.7/site-packages (from matplotlib->gradio==3.14.0) (4.38.0)\nRequirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/conda/lib/python3.7/site-packages (from requests->gradio==3.14.0) (1.26.14)\nRequirement already satisfied: h11>=0.8 in /opt/conda/lib/python3.7/site-packages (from uvicorn->gradio==3.14.0) (0.14.0)\nRequirement already satisfied: click>=7.0 in /opt/conda/lib/python3.7/site-packages (from uvicorn->gradio==3.14.0) (8.1.3)\nRequirement already satisfied: importlib-metadata in /opt/conda/lib/python3.7/site-packages (from click>=7.0->uvicorn->gradio==3.14.0) (4.11.4)\nRequirement already satisfied: importlib-resources>=1.4.0 in /opt/conda/lib/python3.7/site-packages (from jsonschema>=3.0->altair->gradio==3.14.0) (5.10.2)\nRequirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /opt/conda/lib/python3.7/site-packages (from jsonschema>=3.0->altair->gradio==3.14.0) (0.19.3)\nRequirement already satisfied: pkgutil-resolve-name>=1.3.10 in /opt/conda/lib/python3.7/site-packages (from jsonschema>=3.0->altair->gradio==3.14.0) (1.3.10)\nCollecting uc-micro-py\n Downloading uc_micro_py-1.0.1-py3-none-any.whl (6.2 kB)\nRequirement already satisfied: six>=1.5 in /opt/conda/lib/python3.7/site-packages (from python-dateutil>=2.7.3->pandas->gradio==3.14.0) (1.16.0)\nRequirement already satisfied: zipp>=3.1.0 in /opt/conda/lib/python3.7/site-packages (from importlib-resources>=1.4.0->jsonschema>=3.0->altair->gradio==3.14.0) (3.11.0)\nBuilding wheels for collected packages: ffmpy\n Building wheel for ffmpy (setup.py) ... \u001b[?25ldone\n\u001b[?25h Created wheel for ffmpy: filename=ffmpy-0.3.0-py3-none-any.whl size=4711 sha256=92ce06a3d5c39ef58497e3878c9ddbe018e646d1110a1e7af66a0440f631746d\n Stored in directory: /root/.cache/pip/wheels/c0/96/80/1aeaaf27265398a7393b296714b84e51a7d00101f8a665a25a\nSuccessfully built ffmpy\nInstalling collected packages: ffmpy, uc-micro-py, python-multipart, linkify-it-py, httpcore, httpx, gradio\nSuccessfully installed ffmpy-0.3.0 gradio-3.14.0 httpcore-0.17.0 httpx-0.24.0 linkify-it-py-1.0.3 python-multipart-0.0.6 uc-micro-py-1.0.1\n\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n\u001b[0mNote: you may need to restart the kernel to use updated packages.\n","output_type":"stream"}]},{"cell_type":"code","source":"import gradio as gr\nimport numpy as np\nimport tensorflow as tf\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nimport pickle\nfrom tensorflow.keras.models import load_model\n","metadata":{"execution":{"iopub.status.busy":"2023-04-28T20:22:05.210684Z","iopub.execute_input":"2023-04-28T20:22:05.211495Z","iopub.status.idle":"2023-04-28T20:22:05.220560Z","shell.execute_reply.started":"2023-04-28T20:22:05.211413Z","shell.execute_reply":"2023-04-28T20:22:05.218904Z"},"trusted":true},"execution_count":8,"outputs":[]},{"cell_type":"code","source":"# Load the RGB to hyperspectral conversion model\nconverion_model = load_model('/kaggle/input/convmo/Conversion_model.h5')\n\n# Load the cancer classification model\n#cancer_model = pickle.load(open(\"/kaggle/input/classi/ClassRF (1).pkl\", \"rb\"))\n\ncancer_model = pickle.load(open(\"/kaggle/input/logistic/LRclass.pkl\", \"rb\"))","metadata":{"execution":{"iopub.status.busy":"2023-04-28T20:24:35.081173Z","iopub.execute_input":"2023-04-28T20:24:35.081743Z","iopub.status.idle":"2023-04-28T20:24:36.467983Z","shell.execute_reply.started":"2023-04-28T20:24:35.081694Z","shell.execute_reply":"2023-04-28T20:24:36.465793Z"},"trusted":true},"execution_count":9,"outputs":[]},{"cell_type":"code","source":"def classify(rgb_image):\n img = Image.fromarray(rgb_image.astype('uint8'), 'RGB')\n img = img.resize((272, 512))\n arr = np.array(img).astype('float32') / 255.0\n new_size = (272, 512)\n resized_rgb_img = tf.image.resize(arr, new_size)\n resized_rgb_img = tf.reshape(resized_rgb_img, (272, 512, 3))\n resized_rgb_img = np.expand_dims(resized_rgb_img , axis=0)\n \n # Convert the RGB image to hyperspectral using your model\n hyperspectral_image = converion_model(resized_rgb_img)\n hyperspectral_image = tf.image.resize(hyperspectral_image, new_size)\n hyperspectral_image = tf.reshape(hyperspectral_image, (272, 512, 16))\n imgplot = hyperspectral_image.numpy().astype(np.float32)\n imgplot= imgplot.reshape(-1, 272*512*16)\n prediction = cancer_model.predict(imgplot)\n if np.argmax(prediction) == 0:\n x= \"cancer\"\n else:\n x=\"not a cancer\"\n return x ","metadata":{"execution":{"iopub.status.busy":"2023-04-28T20:24:50.438626Z","iopub.execute_input":"2023-04-28T20:24:50.440038Z","iopub.status.idle":"2023-04-28T20:24:50.449870Z","shell.execute_reply.started":"2023-04-28T20:24:50.439980Z","shell.execute_reply":"2023-04-28T20:24:50.448539Z"},"trusted":true},"execution_count":10,"outputs":[]},{"cell_type":"code","source":"# Define the Gradio interface\n#image_input = gr.inputs.Image()\noutput_label = gr.components.Label()\n#output_label=[\"text\"]\nimage_input = gr.components.Image()\ngr.Interface(\n classify, \n image_input, \n output_label, \n title=\"RGB to Hyperspectral Conversion and Cancer Classification\", \n description=\"Upload an RGB image and get a prediction of whether you have skin cancer or not.\"\n).launch(share=True)","metadata":{"execution":{"iopub.status.busy":"2023-04-28T20:24:54.496632Z","iopub.execute_input":"2023-04-28T20:24:54.497067Z","iopub.status.idle":"2023-04-28T20:25:03.058479Z","shell.execute_reply.started":"2023-04-28T20:24:54.497029Z","shell.execute_reply":"2023-04-28T20:25:03.056997Z"},"trusted":true},"execution_count":11,"outputs":[{"name":"stdout","text":"Running on local URL: http://127.0.0.1:7860\n\nSetting up a public link... we have recently upgraded the way public links are generated. If you encounter any problems, please report the issue and downgrade to gradio version 3.13.0\n.\nRunning on public URL: https://3d8a5098-9d6d-46ab.gradio.live\n\nThis share link expires in 72 hours. For free permanent hosting and GPU upgrades (NEW!), check out Spaces: https://huggingface.co/spaces\n","output_type":"stream"},{"output_type":"display_data","data":{"text/plain":"<IPython.core.display.HTML object>","text/html":"<div><iframe src=\"https://3d8a5098-9d6d-46ab.gradio.live\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"},"metadata":{}},{"execution_count":11,"output_type":"execute_result","data":{"text/plain":""},"metadata":{}}]}]}
|