{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"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","_kg_hide-input":true,"_kg_hide-output":true,"execution":{"iopub.status.busy":"2022-03-21T17:58:37.665271Z","iopub.execute_input":"2022-03-21T17:58:37.665870Z","iopub.status.idle":"2022-03-21T17:59:09.800640Z","shell.execute_reply.started":"2022-03-21T17:58:37.665777Z","shell.execute_reply":"2022-03-21T17:59:09.799768Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:orange; padding:10px\">Never forget Maths</span></h1><br>","metadata":{}},{"cell_type":"code","source":"import math\nimport random","metadata":{"execution":{"iopub.status.busy":"2022-03-21T17:59:31.973018Z","iopub.execute_input":"2022-03-21T17:59:31.973304Z","iopub.status.idle":"2022-03-21T17:59:31.976747Z","shell.execute_reply.started":"2022-03-21T17:59:31.973270Z","shell.execute_reply":"2022-03-21T17:59:31.976060Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport os\nimport matplotlib.pyplot as plt\n%matplotlib inline\nfrom PIL import Image\nfrom glob import glob\nimport cv2","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-03-21T17:59:54.156884Z","iopub.execute_input":"2022-03-21T17:59:54.157379Z","iopub.status.idle":"2022-03-21T17:59:54.626338Z","shell.execute_reply.started":"2022-03-21T17:59:54.157347Z","shell.execute_reply":"2022-03-21T17:59:54.625344Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<center style=\"font-family:verdana;\"><h1 style=\"font-size:200%; padding: 10px; background: black;\"><b style=\"color:orange;\">Strength. Utility. Beauty. Vitruvius Principles. Perfect Proportion</b></h1></center>\n\n\n\"Vitruvius  was a Roman architect and engineer during the 1st century BCE, known for his multi-volume work entitled De architectura (around year 15 b.c.). He originated the idea that all buildings should have three attributes: firmitas, utilitas, and venustas (\"strength\", \"utility\", and \"beauty\"). These principles were later widely adopted in Roman architecture. His discussion of perfect proportion in architecture and the human body led to the famous Renaissance drawing of the Vitruvian Man by Leonardo da Vinci.\"\n\n\"In 1486, the book was reprinted in Rome for the first time. It was the work of Fray Giovanni Sulpicio de Veroli and it was an instant hit. All the MASTERS begin its study.\"\n\nhttps://en.wikipedia.org/wiki/Vitruvius","metadata":{}},{"cell_type":"code","source":"def plotImages(vitruvian,directory):\n    print(vitruvian)\n    multipleImages = glob(directory)\n    plt.rcParams['figure.figsize'] = (15, 15)\n    plt.subplots_adjust(wspace=0, hspace=0)\n    i_ = 0\n    for l in multipleImages[:25]:\n        im = cv2.imread(l)\n        im = cv2.resize(im, (128, 128)) \n        plt.subplot(5, 5, i_+1) #.set_title(l)\n        plt.imshow(cv2.cvtColor(im, cv2.COLOR_BGR2RGB)); plt.axis('off')\n        i_ += 1\n        \n        \nplotImages(\"Masks in Gray Scale\",\"../input/hotel-id-to-combat-human-trafficking-2022-fgvc9/train_masks/**\")","metadata":{"execution":{"iopub.status.busy":"2022-03-21T17:59:59.699006Z","iopub.execute_input":"2022-03-21T17:59:59.699276Z","iopub.status.idle":"2022-03-21T18:00:02.700366Z","shell.execute_reply.started":"2022-03-21T17:59:59.699249Z","shell.execute_reply":"2022-03-21T18:00:02.699759Z"},"_kg_hide-input":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"\"Vitruvius, the architect, says in his work on architecture that the measurements of the human body are distributed by Nature as follows that is that 4 fingers make 1 palm, and 4 palms make 1 foot, 6 palms make 1 cubit; 4 cubits make a man's height.\"\n\n![](https://slideplayer.com/slide/16834018/97/images/2/The+Drawing+The+Vitruvian+Man+is+a+famous+drawing+by+Leonardo+da+Vinci+from+1487+a.d..jpg)slideplayer.com","metadata":{}},{"cell_type":"markdown","source":"\"The navel is in the centre of the human body, and, if in a man lying with his face upward, and his hands and feet extended, from his navel as the centre, a circle be described, it will touch his fingers and toes. It is not alone by a circle, that the human body is thus circumscribed, as may be seen by placing it within a square.\"\n\n\"For measuring from the feet to the crown of the head, and then across the arms fully extended, we find the latter measure equal to the former; so that lines at right angles to each other, enclosing the figure, will form a square.\"\n\n\"So, what the masters attempted to do was to draw a human figure that matched Vitruvius set of proportions, and that was inscribed in a circle and a square.\"\n\n\"These MASTERS also draw Vitruvian Men:\"\n\n\"Fra Giovanni Giocondo, Cesare Cesariano, Francisco Giorgi, Taccola, Francisco di Giorgio, Giacomo Andrea Da Ferrara\"\n\n\"Some scholars think that Leonardo may have copied the idea from the last one\".\n\nhttps://owlcation.com/humanities/Leonardo-Da-Vincis-Vitruvian-Man-Explained","metadata":{}},{"cell_type":"markdown","source":"<center style=\"font-family:verdana;\"><h1 style=\"font-size:200%; padding: 10px; background: black;\"><b style=\"color:orange;\">Talented were Unknown. Those with less talent but greater political position were famous. Sounds Algorithm Familiar?</b></h1></center>\n\nVitruvius' De architectura was widely copied and survives in many dozens of manuscripts throughout the Middle Ages.\n\n\"In Book III, Chapter 1, Paragraph 3, Vitruvius writes about the proportions of man\"\n\n\"Vitruvius makes the point that the work of some of the most talented are unknown, while many of those of lesser talent but greater political position are famous. This theme runs through Vitruvius's ten books repeatedly – echoing an implicit prediction that he and his works will also be forgotten.\"\n\n\"Vitruvius illustrates this point by naming what he considers are the most talented individuals in history. Implicitly challenging the reader that they have never heard of some of these people, Vitruvius goes on and predicts that some of these individuals will be forgotten and their works lost, while other, less deserving political characters of history will be forever remembered with pageantry.\"\n\nCheck Vitruvius lists:\n\nList of physicists: Thales, Democritus, Anaxagoras, Xenophanes\n\nList of philosophers: Socrates, Plato, Aristotle, Zeno, Epicurus\n\nList of kings: Croesus, Alexander the Great, Darius\n\n<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:orange; padding:10px\">List Plagiarism and List Abusing Dead Authors</span></h1><br>\n\nOn plagiarism: Aristophanes, Ptolemy I Soter, a person named Attalus\n\nOn abusing dead authors: Zoilus Homeromastix, Ptolemy II Philadelphus\n\n\nON PLAGIARISM and ON ABUSING DEAD AUTHORS List??!!!!  Really??!!\n\nhttps://en.wikipedia.org/wiki/Vitruvius","metadata":{}},{"cell_type":"code","source":"def plotImages(vitruvian,directory):\n    print(vitruvian)\n    multipleImages = glob(directory)\n    plt.rcParams['figure.figsize'] = (15, 15)\n    plt.subplots_adjust(wspace=0, hspace=0)\n    i_ = 0\n    for l in multipleImages[:25]:\n        im = cv2.imread(l)\n        im = cv2.resize(im, (128, 128)) \n        plt.subplot(5, 5, i_+1) #.set_title(l)\n        plt.imshow(cv2.cvtColor(im, cv2.COLOR_BGR2RGB)); plt.axis('off')\n        i_ += 1\n        \n        \nplotImages(\"Masks in Gray Scale\",\"../input/hotel-id-to-combat-human-trafficking-2022-fgvc9/test_images/abc.jpg\")","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:00:23.755770Z","iopub.execute_input":"2022-03-21T18:00:23.756871Z","iopub.status.idle":"2022-03-21T18:00:24.043931Z","shell.execute_reply.started":"2022-03-21T18:00:23.756810Z","shell.execute_reply":"2022-03-21T18:00:24.042722Z"},"_kg_hide-input":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:orange; padding:10px\">Squaring the Circle</span></h1><br>\n\n\n\"Squaring the circle is a problem proposed by ancient geometers. It is the challenge of constructing a square with the same area as a given circle by using only a finite number of steps with compass and straightedge. The difficulty of the problem raised the question of whether specified axioms of Euclidean geometry concerning the existence of lines and circles implied the existence of such a square.\"\n\n\"In 1882, the task was proven to be impossible, as a consequence of the Lindemann–Weierstrass theorem, which proves that pi (π) is a transcendental, rather than an algebraic irrational number; that is, it is not the root of any polynomial with rational coefficients. It had been known for decades that the construction would be impossible if π were transcendental, but π was not proven to be transcendental until 1882. Approximate squaring to any given non-perfect accuracy, in contrast, is possible in a finite number of steps, since there are rational numbers arbitrarily close to π.\"\n\n\"The expression \"squaring the circle\" is sometimes used as a metaphor for trying to do the impossible.\"","metadata":{}},{"cell_type":"markdown","source":"#Squaring the Circle with HTML/CSS by Shiv Kumar Ganesh\n\nhttps://www.kaggle.com/code/shivkumarganesh/embed-html-css-in-notebook-create-shapes-cards/notebook","metadata":{}},{"cell_type":"markdown","source":"<div style=\"height: 150px;width: 150px;background-color: #DC143C;border-radius: 50%;\"></div>","metadata":{}},{"cell_type":"markdown","source":"<div style=\"height: 150px;width: 150px;background-color: #DC143C;\"></div>","metadata":{}},{"cell_type":"markdown","source":"<div style=\"width: 100px;height: 50px;transform: skew(50deg);background: #DC143C;\"></div>","metadata":{}},{"cell_type":"markdown","source":"<div style=\"border-bottom: 150px solid #DC143C;border-left: 125px solid transparent;border-right: 125px solid transparent;height: 0;width: 125px;\"></div>","metadata":{}},{"cell_type":"markdown","source":"![](https://www.revistaquestaodeciencia.com.br/sites/default/files/inline-images/SQUARING_INTERNA_OK.jpg)revistaquestaodeciencia.com.br","metadata":{}},{"cell_type":"code","source":"#Code by Nagesh Singh Chauhan https://www.kaggle.com/nageshsingh/generate-realistic-human-face-using-gan\n\nfrom tqdm import tqdm\nfrom PIL import Image as Img\nfrom keras import Input\nfrom keras.layers import Dense, Reshape, LeakyReLU, Conv2D, Conv2DTranspose, Flatten, Dropout\nfrom keras.models import Model\nfrom tensorflow.keras.optimizers import RMSprop","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:09:32.468665Z","iopub.execute_input":"2022-03-21T18:09:32.468941Z","iopub.status.idle":"2022-03-21T18:09:38.717123Z","shell.execute_reply.started":"2022-03-21T18:09:32.468914Z","shell.execute_reply":"2022-03-21T18:09:38.716323Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Nagesh Singh Chauhan https://www.kaggle.com/nageshsingh/generate-realistic-human-face-using-gan\n\nPIC_DIR = f'../input/hotel-id-to-combat-human-trafficking-2022-fgvc9/train_masks/'\n\nIMAGES_COUNT = 1125\n\nORIG_WIDTH = 178\nORIG_HEIGHT = 208\ndiff = (ORIG_HEIGHT - ORIG_WIDTH) // 2\n\nWIDTH = 128\nHEIGHT = 128\n\ncrop_rect = (0, diff, ORIG_WIDTH, ORIG_HEIGHT - diff)\n\nimages = []\nfor pic_file in tqdm(os.listdir(PIC_DIR)[:IMAGES_COUNT]):\n    pic = Image.open(PIC_DIR + pic_file).crop(crop_rect)\n    pic.thumbnail((WIDTH, HEIGHT), Image.ANTIALIAS)\n    images.append(np.uint8(pic))","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:09:42.893183Z","iopub.execute_input":"2022-03-21T18:09:42.893469Z","iopub.status.idle":"2022-03-21T18:11:02.617239Z","shell.execute_reply.started":"2022-03-21T18:09:42.893438Z","shell.execute_reply":"2022-03-21T18:11:02.616001Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Nagesh Singh Chauhan https://www.kaggle.com/nageshsingh/generate-realistic-human-face-using-gan\n\n#Display first 5 images #Original 25 images\nplt.figure(1, figsize=(10, 10))\nfor i in range(5): #Original 25\n    plt.subplot(5, 1, i+1) #Original (5, 5, i+1)\n    plt.imshow(images[i])\n    plt.axis('off')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:11:11.230706Z","iopub.execute_input":"2022-03-21T18:11:11.231048Z","iopub.status.idle":"2022-03-21T18:11:11.490501Z","shell.execute_reply.started":"2022-03-21T18:11:11.231014Z","shell.execute_reply":"2022-03-21T18:11:11.489549Z"},"_kg_hide-input":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Volody  https://www.kaggle.com/code/volody/threshold-segmentation\n\nimg_list = ['00026.png', '00004.png', '00000.png', '00010.png']\nfig = plt.figure(figsize=(16, 16))\nfor i in range(4):\n    x = fig.add_subplot(2, 2, i+1)\n    image = plt.imread('/kaggle/input/hotel-id-to-combat-human-trafficking-2022-fgvc9/train_masks/'+img_list[i])\n    x.set_title(\"{image} ({shape[0]},{shape[1]})\".format(image=img_list[i],shape=image.shape))\n    plt.imshow(image)","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-03-21T18:11:17.632598Z","iopub.execute_input":"2022-03-21T18:11:17.633501Z","iopub.status.idle":"2022-03-21T18:11:25.551487Z","shell.execute_reply.started":"2022-03-21T18:11:17.633459Z","shell.execute_reply":"2022-03-21T18:11:25.550522Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"\"Da Vinci is not the only—or even the first—artist to attempt illustrating Virtruvius's proportions, though his work is the most famous.\"\n\nhttps://www.artandobject.com/news/history-and-influence-da-vincis-vitruvian-man\n\n\"What was the original concept of Vitruvian man, according to Roman engineer and architect Vitruvius?\"\n\n\"For a man to be perfect, his hands and feet would touch the circumference of a circle when extended.\"\n\nhttps://quizlet.com/38130403/art-history-the-masters-i-leonardo-da-vinci-flash-cards/","metadata":{}},{"cell_type":"code","source":"#Code by Yaroslav Isaienkov https://www.kaggle.com/ihelon/monet-eda-and-visualization-techniques\n\n#https://www.kaggle.com/code/mpwolke/rijksmuseum-augmentation\n\ndef visualize_images(path, n_images, is_random=True, figsize=(16, 16)):\n    plt.figure(figsize=figsize)\n    w = int(n_images ** .5)\n    h = math.ceil(n_images / w)\n    \n    all_names = os.listdir(path)\n    image_names = all_names[:n_images]   \n    if is_random:\n        image_names = random.sample(all_names, n_images)\n            \n    for ind, image_name in enumerate(image_names):\n        img = cv2.imread(os.path.join(path, image_name))\n        img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) \n        plt.subplot(h, w, ind + 1)\n        plt.imshow(img)\n        plt.xticks([])\n        plt.yticks([])","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:11:33.031351Z","iopub.execute_input":"2022-03-21T18:11:33.031642Z","iopub.status.idle":"2022-03-21T18:11:33.039925Z","shell.execute_reply.started":"2022-03-21T18:11:33.031590Z","shell.execute_reply":"2022-03-21T18:11:33.038929Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Yaroslav Isaienkov https://www.kaggle.com/ihelon/monet-eda-and-visualization-techniques\n#https://www.kaggle.com/code/mpwolke/rijksmuseum-augmentation\n\nvitruvians_PNG_PATH = '../input/hotel-id-to-combat-human-trafficking-2022-fgvc9/train_masks'","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:11:49.379240Z","iopub.execute_input":"2022-03-21T18:11:49.379745Z","iopub.status.idle":"2022-03-21T18:11:49.383779Z","shell.execute_reply.started":"2022-03-21T18:11:49.379705Z","shell.execute_reply":"2022-03-21T18:11:49.382918Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:orange; padding:10px\">Iacomo Andrea</span></h1><br>\n\n\nIacomo Andrea, also known as Giacomo Andrea de Ferrara, was an architect from Ferrara and the author on a commentary on Vitruvius. \n\nA Vitruvian Man prototype by Giacomo Andrea\n\nLuca Pacioli wrote that Andrea was almost like a brother to Leonardo da Vinci. Andrea drew a prototypical Vitruvian Man which may have served as the basis for Da Vinci's drawing or just been born alongside as a collaborative effort.\n\n![](https://upload.wikimedia.org/wikipedia/commons/6/69/Vitruvian_Man_by_Giacomo_Andrea.jpg)","metadata":{}},{"cell_type":"code","source":"#Code by Yaroslav Isaienkov https://www.kaggle.com/ihelon/monet-eda-and-visualization-techniques\n#https://www.kaggle.com/code/mpwolke/rijksmuseum-augmentation\n\nvisualize_images(vitruvians_PNG_PATH, 9)","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:11:56.701122Z","iopub.execute_input":"2022-03-21T18:11:56.701708Z","iopub.status.idle":"2022-03-21T18:11:59.509510Z","shell.execute_reply.started":"2022-03-21T18:11:56.701669Z","shell.execute_reply":"2022-03-21T18:11:59.508598Z"},"_kg_hide-input":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Yaroslav Isaienkov https://www.kaggle.com/ihelon/monet-eda-and-visualization-techniques\n#https://www.kaggle.com/code/mpwolke/rijksmuseum-augmentation\n\ndef show_color_histogram(path):\n    image_names = os.listdir(path)\n    image_name = random.choice(image_names)\n    img = cv2.imread(os.path.join(path, image_name))\n    img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) \n    fig = make_subplots(1, 2)\n\n    fig.add_trace(go.Image(z=img), 1, 1)\n    for channel, color in enumerate(['red', 'green', 'blue']):\n        fig.add_trace(\n            go.Histogram(\n                x=img[..., channel].ravel(), \n                opacity=0.5,\n                marker_color=color, \n                name='%s channel' %color\n            ), 1, 2)\n    fig.update_layout(height=400)\n    fig.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:15:43.566577Z","iopub.execute_input":"2022-03-21T18:15:43.566896Z","iopub.status.idle":"2022-03-21T18:15:43.574954Z","shell.execute_reply.started":"2022-03-21T18:15:43.566864Z","shell.execute_reply":"2022-03-21T18:15:43.574091Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:orange; padding:10px\">The Vitruvian Man by Leonardo da Vinci</span></h1><br>\n\n\n\"The Vitruvian Man was created by Leonardo da Vinci around the year 1487. It is accompanied by notes based on the work of the famed architect, Vitruvius Pollio. The drawing, which is in pen and ink on paper, depicts a male figure in two superimposed positions with his arms and legs apart and simultaneously inscribed in a circle and square. The drawing and text are sometimes called the Canon of Proportions or, less often, Proportions of Man.\" \n\n\"The proportional relationship of the parts reflects the universal design.  These qualities are thus shared equally by God's creation of the human body and the human being's own production of a good building. In the late 1480s, this theme of the artistic microcosm emerged as one of the great unifying principles of his thought.\" \n\nThis image provides a perfect example of Leonardo's keen interest in proportion. In addition, this picture represents a cornerstone of Leonardo's attempts to relate man to nature.  Vitruvian Man as a cosmografia del minor mondo (cosmography of the microcosm). He believed the workings of the human body to be an analogy for the workings of the universe.\"\n\nThe square represents the material World and the circle\n\n\"The Vitruvian Man, a late 15th-century drawing, intended to explore the idea of proportion, the piece is part work of art and part mathematical diagram, conveying the Old Master's belief that “everything connects to everything else.”\n\nhttps://www.leonardodavinci.net/the-vitruvian-man.jsp\n\n![](https://miro.medium.com/max/600/1*MQn9bLm0xRalH0Q8uoPKpw.png)medium.com","metadata":{}},{"cell_type":"code","source":"#Code by Yaroslav Isaienkov https://www.kaggle.com/ihelon/monet-eda-and-visualization-techniques\n#https://www.kaggle.com/code/mpwolke/rijksmuseum-augmentation\n\ndef color_hist_visualization(image_path, figsize=(16, 4)):\n    plt.figure(figsize=figsize)\n    \n    img = cv2.imread(image_path)\n    img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) \n    plt.subplot(1, 4, 1)\n    plt.imshow(img)\n    plt.axis(\"off\")\n    \n    colors = [\"red\", \"green\", \"blue\"]\n    for i in range(len(colors)):\n        plt.subplot(1, 4, i + 2)\n        plt.hist(\n            img[:, :, i].reshape(-1),\n            bins=25,\n            alpha=0.5,\n            color=colors[i],\n            density=True\n        )\n        plt.xlim(0, 255)\n        plt.xticks([])\n        plt.yticks([])\n        \n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:17:37.265090Z","iopub.execute_input":"2022-03-21T18:17:37.265910Z","iopub.status.idle":"2022-03-21T18:17:37.275013Z","shell.execute_reply.started":"2022-03-21T18:17:37.265861Z","shell.execute_reply":"2022-03-21T18:17:37.274047Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Yaroslav Isaienkov https://www.kaggle.com/ihelon/monet-eda-and-visualization-techniques\n#https://www.kaggle.com/code/mpwolke/rijksmuseum-augmentation\n\nimg_path = '../input/hotel-id-to-combat-human-trafficking-2022-fgvc9/train_masks/00221.png'\ncolor_hist_visualization(img_path)\n\nimg_path = '../input/hotel-id-to-combat-human-trafficking-2022-fgvc9/train_images/10947/000030890.jpg'\ncolor_hist_visualization(img_path)\n\nimg_path = '../input/hotel-id-to-combat-human-trafficking-2022-fgvc9/test_images/abc.jpg'\ncolor_hist_visualization(img_path)","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:38:27.612055Z","iopub.execute_input":"2022-03-21T18:38:27.612423Z","iopub.status.idle":"2022-03-21T18:38:29.480256Z","shell.execute_reply.started":"2022-03-21T18:38:27.612393Z","shell.execute_reply":"2022-03-21T18:38:29.479377Z"},"_kg_hide-input":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Yaroslav Isaienkov https://www.kaggle.com/ihelon/monet-eda-and-visualization-techniques\n#https://www.kaggle.com/code/mpwolke/rijksmuseum-augmentation\n\nimport plotly.graph_objs as go\nfrom plotly.subplots import make_subplots\n\nshow_color_histogram(vitruvians_PNG_PATH)","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:39:47.391159Z","iopub.execute_input":"2022-03-21T18:39:47.391431Z","iopub.status.idle":"2022-03-21T18:39:48.025498Z","shell.execute_reply.started":"2022-03-21T18:39:47.391402Z","shell.execute_reply":"2022-03-21T18:39:48.024473Z"},"_kg_hide-input":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Yaroslav Isaienkov https://www.kaggle.com/ihelon/monet-eda-and-visualization-techniques\n#https://www.kaggle.com/code/mpwolke/rijksmuseum-augmentation\n\ndef batch_visualization(path, n_images, is_random=True, figsize=(16, 16)):\n    plt.figure(figsize=figsize)\n    \n    w = int(n_images ** .5)\n    h = math.ceil(n_images / w)\n    \n    all_names = os.listdir(path)\n    \n    image_names = all_names[:n_images]\n    if is_random:\n        image_names = random.sample(all_names, n_images)\n    \n    for ind, image_name in enumerate(image_names):\n        img = cv2.imread(os.path.join(path, image_name))\n        img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) \n        plt.subplot(h, w, ind + 1)\n        plt.imshow(img)\n        plt.axis(\"off\")\n    \n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:40:48.210299Z","iopub.execute_input":"2022-03-21T18:40:48.210616Z","iopub.status.idle":"2022-03-21T18:40:48.219168Z","shell.execute_reply.started":"2022-03-21T18:40:48.210569Z","shell.execute_reply":"2022-03-21T18:40:48.218281Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Yaroslav Isaienkov https://www.kaggle.com/ihelon/monet-eda-and-visualization-techniques\n#https://www.kaggle.com/code/mpwolke/rijksmuseum-augmentation\n\nbatch_visualization(vitruvians_PNG_PATH, 1, is_random=True, figsize=(5, 5))","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:41:21.228638Z","iopub.execute_input":"2022-03-21T18:41:21.228933Z","iopub.status.idle":"2022-03-21T18:41:22.760156Z","shell.execute_reply.started":"2022-03-21T18:41:21.228900Z","shell.execute_reply":"2022-03-21T18:41:22.759428Z"},"_kg_hide-input":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Yaroslav Isaienkov https://www.kaggle.com/ihelon/monet-eda-and-visualization-techniques\n#https://www.kaggle.com/code/mpwolke/rijksmuseum-augmentation\n\nbatch_visualization(vitruvians_PNG_PATH, 4, is_random=True, figsize=(10, 10))","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:41:54.178210Z","iopub.execute_input":"2022-03-21T18:41:54.179080Z","iopub.status.idle":"2022-03-21T18:41:54.824486Z","shell.execute_reply.started":"2022-03-21T18:41:54.179040Z","shell.execute_reply":"2022-03-21T18:41:54.823679Z"},"_kg_hide-input":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"batch_visualization(vitruvians_PNG_PATH, 9, is_random=True)","metadata":{"execution":{"iopub.status.busy":"2022-03-21T18:42:23.580430Z","iopub.execute_input":"2022-03-21T18:42:23.580731Z","iopub.status.idle":"2022-03-21T18:42:29.728778Z","shell.execute_reply.started":"2022-03-21T18:42:23.580702Z","shell.execute_reply":"2022-03-21T18:42:29.727952Z"},"_kg_hide-input":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"![](http://4.bp.blogspot.com/-0JSZeiVfd_c/T5q4putpEsI/AAAAAAAADQA/0CYCp5zz3vo/s1600/natural-history.gif)http://art109miami.blogspot.com/2012/04/vitruvian-humor.html","metadata":{}},{"cell_type":"markdown","source":"#Acknowledgements:\n\nYaroslav Isaienkov https://www.kaggle.com/ihelon/monet-eda-and-visualization-techniques\n\nVolody  https://www.kaggle.com/code/volody/threshold-segmentation\n\nNagesh Singh Chauhan https://www.kaggle.com/nageshsingh/generate-realistic-human-face-using-gan\n\nShiv Kumar Ganesh https://www.kaggle.com/code/shivkumarganesh/embed-html-css-in-notebook-create-shapes-cards/notebook\n\nAnd obviously THE MASTERS: Vitruvius, Iacomo Andrea and Leonardo (Da Vinci).","metadata":{}},{"cell_type":"markdown","source":"#Copying someone's work, means learn, transform it, add value and share it with Kaggle community like a gift.","metadata":{}}]}