{"id":1942,"date":"2016-06-24T19:07:26","date_gmt":"2016-06-24T10:07:26","guid":{"rendered":"http:\/\/avinton.com\/?page_id=1942"},"modified":"2023-06-22T11:36:56","modified_gmt":"2023-06-22T02:36:56","slug":"image-classification-task","status":"publish","type":"page","link":"https:\/\/avinton.com\/en\/academy\/image-classification-task\/","title":{"rendered":"Image Classification Task"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]<\/p>\n<h3>Task Explanation<\/h3>\n<p>This task is designed to demonstrate how we can use programming to solve a real-world problem.<\/p>\n<p>We will extract images from pdf files and classify them into 3 categories:<\/p>\n<ul>\n<li>Text<\/li>\n<li>Diagram<\/li>\n<li>Image<\/li>\n<\/ul>\n<p>Some sample pdf files can be downloaded <a href=\"https:\/\/drive.google.com\/file\/d\/1Y0SvP-S8nrEcesTun4FV5tJGr9Hsk73z\/view\">here<\/a>.<\/p>\n<p>Examples of the image types are:<\/p>\n<div>Text:<\/div>\n<div><img decoding=\"async\" class=\"aligncenter wp-image-81123\" src=\"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/text.jpg\" alt=\"Image Classification Task\" width=\"468\" height=\"754\" srcset=\"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/text.jpg 602w, https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/text-186x300.jpg 186w, https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/text-104x167.jpg 104w\" sizes=\"(max-width: 468px) 100vw, 468px\" \/><\/div>\n<p>Diagram:<br \/>\n<img decoding=\"async\" class=\"aligncenter wp-image-81129\" src=\"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/diagram.jpg\" alt=\"Image Classification Task\" width=\"537\" height=\"768\" srcset=\"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/diagram.jpg 638w, https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/diagram-210x300.jpg 210w, https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/diagram-117x167.jpg 117w\" sizes=\"(max-width: 537px) 100vw, 537px\" \/><\/p>\n<p>Image:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-81127\" src=\"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/image.jpg\" alt=\"Image Classification Task\" width=\"592\" height=\"912\" srcset=\"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/image.jpg 592w, https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/image-195x300.jpg 195w, https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/image-108x167.jpg 108w\" sizes=\"(max-width: 592px) 100vw, 592px\" \/><\/p>\n<p>For this task we will use the OpenCV library.<br \/>\nThe environment setup is described <a href=\"https:\/\/avinton.com\/academy\/opencv4-5-1-python3-8-ubuntu20-04-install\/\" target=\"_blank\" rel=\"noopener\">here<\/a>\u00a0and <a href=\"https:\/\/avinton.com\/academy\/opencv%E3%81%AE%E3%83%86%E3%82%B9%E3%83%88%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<p>For the image class we can further split the images into their individual photos ex:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-81125\" src=\"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/image2.jpg\" alt=\"Image Classification Task\" width=\"526\" height=\"397\" srcset=\"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/image2.jpg 526w, https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/image2-300x226.jpg 300w, https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/image2-221x167.jpg 221w\" sizes=\"(max-width: 526px) 100vw, 526px\" \/><\/p>\n<p>This is an individual task but we will collaborate on this during the session.<\/p>\n<p>You can ask questions any time via email or google hangouts and also during the training.<\/p>\n<p>The expected output is as follows:<\/p>\n<ul>\n<li>One directory per PDF file<\/li>\n<li>Inside the directory a list of images from the pdf file<\/li>\n<li>The directory should also contain a text file with the image name and the image type<\/li>\n<li>Photos extracted from the Image types should be prefixed with extracted ex: extracted_###.jpg<\/li>\n<\/ul>\n<p>Text file should look like this:<\/p>\n<div class=\"sites-codeblock sites-codesnippet-block\">\n<div style=\"font-size: 13.3333px;\"><code>img_1.jpg\u00a0\u00a0 \u00a0<\/code><code>\u00a0 \u00a0 \u00a0Text<\/code><\/div>\n<div style=\"font-size: 13.3333px;\"><code>img_2.jpg\u00a0\u00a0 \u00a0<\/code><code>\u00a0 \u00a0 \u00a0Text<\/code><\/div>\n<div style=\"font-size: 13.3333px;\"><code>img_3.jpg\u00a0\u00a0 \u00a0<\/code><code>\u00a0 \u00a0 \u00a0Diagram<\/code><\/div>\n<div style=\"font-size: 13.3333px;\"><code>img_4.jpg\u00a0\u00a0 \u00a0<\/code><code>\u00a0 \u00a0 \u00a0Diagram<\/code><\/div>\n<div><code>img_5.jpg<\/code><code>\u00a0 \u00a0 \u00a0Image<\/code><\/div>\n<div><code>extracted_001<\/code><code>\u00a0\u00a0\u00a0 \u00a0Image<\/code><\/div>\n<div><code>extracted_002 \u00a0 \u00a0 \u00a0 \u00a0 Image<\/code><\/div>\n<p>&nbsp;<\/p>\n<p>Some hints:<\/p>\n<div class=\"sites-codeblock sites-codesnippet-block\">\n<div style=\"display: block; text-align: left;\">For extracting images from PDF files check Linux command pdfimages<\/div>\n<div style=\"display: block; text-align: left;\"><\/div>\n<div style=\"display: block; text-align: left;\">Then we need to loop through the files in a directory ex:<\/div>\n<div style=\"display: block; text-align: left;\"><\/div>\n<div class=\"sites-codeblock sites-codesnippet-block\">\n<div style=\"display: block; text-align: left;\"><code>for directory, subdirectories, files in os.walk(source_folder):<\/code><\/div>\n<p>Loops are common programming structures &#8211; <a href=\"https:\/\/wiki.python.org\/moin\/ForLoop\" target=\"_blank\" rel=\"noopener\">Python For Loops<\/a><\/p>\n<p>&nbsp;<\/p>\n<h3 style=\"display: block; text-align: left;\">Useful References<\/h3>\n<p><a href=\"https:\/\/www.python.org\/doc\/\" target=\"_blank\" rel=\"noopener\">Python Documentation<\/a><\/p>\n<p><a href=\"http:\/\/docs.opencv.org\/2.4\/modules\/refman.html\" target=\"_blank\" rel=\"noopener\" class=\"broken_link\">OpenCV Documentation<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row][vc_column][vc_column_text] Task Explanation This task is designed to demonstrate how we can use programming to solve a real-world problem. We will extract images from pdf files and classify them into 3 categories: Text Diagram Image Some sample pdf files can be downloaded here. Examples of the image types are: Text: Diagram: Image: For this task<br \/><a href=\"https:\/\/avinton.com\/en\/academy\/image-classification-task\/\" class=\"more\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":1906,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-1942","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Image Classification Task - Avinton Japan<\/title>\n<meta name=\"description\" content=\"Task Explanation This task is designed to demonstrate how we can use programming to solve a real-world problem. We will extract images from pdf files and\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/avinton.com\/en\/academy\/image-classification-task\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Image Classification Task - Avinton Japan\" \/>\n<meta property=\"og:description\" content=\"Task Explanation This task is designed to demonstrate how we can use programming to solve a real-world problem. We will extract images from pdf files and\" \/>\n<meta property=\"og:url\" content=\"https:\/\/avinton.com\/en\/academy\/image-classification-task\/\" \/>\n<meta property=\"og:site_name\" content=\"Avinton Japan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Avintons\/\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-22T02:36:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/text.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@AvintonJapan\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/avinton.com\/en\/academy\/image-classification-task\/\",\"url\":\"https:\/\/avinton.com\/en\/academy\/image-classification-task\/\",\"name\":\"Image Classification Task - Avinton Japan\",\"isPartOf\":{\"@id\":\"https:\/\/avinton.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/avinton.com\/en\/academy\/image-classification-task\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/avinton.com\/en\/academy\/image-classification-task\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/text.jpg\",\"datePublished\":\"2016-06-24T10:07:26+00:00\",\"dateModified\":\"2023-06-22T02:36:56+00:00\",\"description\":\"Task Explanation This task is designed to demonstrate how we can use programming to solve a real-world problem. We will extract images from pdf files and\",\"breadcrumb\":{\"@id\":\"https:\/\/avinton.com\/en\/academy\/image-classification-task\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/avinton.com\/en\/academy\/image-classification-task\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/avinton.com\/en\/academy\/image-classification-task\/#primaryimage\",\"url\":\"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/text.jpg\",\"contentUrl\":\"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/text.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/avinton.com\/en\/academy\/image-classification-task\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/avinton.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Avinton Academy\",\"item\":\"https:\/\/avinton.com\/en\/academy\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Image Classification Task\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/avinton.com\/en\/#website\",\"url\":\"https:\/\/avinton.com\/en\/\",\"name\":\"Avinton Japan\",\"description\":\"Tailored Solutions and Consulting in AI and Big Data\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/avinton.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Image Classification Task - Avinton Japan","description":"Task Explanation This task is designed to demonstrate how we can use programming to solve a real-world problem. We will extract images from pdf files and","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/avinton.com\/en\/academy\/image-classification-task\/","og_locale":"en_US","og_type":"article","og_title":"Image Classification Task - Avinton Japan","og_description":"Task Explanation This task is designed to demonstrate how we can use programming to solve a real-world problem. We will extract images from pdf files and","og_url":"https:\/\/avinton.com\/en\/academy\/image-classification-task\/","og_site_name":"Avinton Japan","article_publisher":"https:\/\/www.facebook.com\/Avintons\/","article_modified_time":"2023-06-22T02:36:56+00:00","og_image":[{"url":"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/text.jpg","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_site":"@AvintonJapan","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/avinton.com\/en\/academy\/image-classification-task\/","url":"https:\/\/avinton.com\/en\/academy\/image-classification-task\/","name":"Image Classification Task - Avinton Japan","isPartOf":{"@id":"https:\/\/avinton.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/avinton.com\/en\/academy\/image-classification-task\/#primaryimage"},"image":{"@id":"https:\/\/avinton.com\/en\/academy\/image-classification-task\/#primaryimage"},"thumbnailUrl":"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/text.jpg","datePublished":"2016-06-24T10:07:26+00:00","dateModified":"2023-06-22T02:36:56+00:00","description":"Task Explanation This task is designed to demonstrate how we can use programming to solve a real-world problem. We will extract images from pdf files and","breadcrumb":{"@id":"https:\/\/avinton.com\/en\/academy\/image-classification-task\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/avinton.com\/en\/academy\/image-classification-task\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/avinton.com\/en\/academy\/image-classification-task\/#primaryimage","url":"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/text.jpg","contentUrl":"https:\/\/avinton.com\/wp-content\/uploads\/2023\/05\/text.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/avinton.com\/en\/academy\/image-classification-task\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/avinton.com\/en\/"},{"@type":"ListItem","position":2,"name":"Avinton Academy","item":"https:\/\/avinton.com\/en\/academy\/"},{"@type":"ListItem","position":3,"name":"Image Classification Task"}]},{"@type":"WebSite","@id":"https:\/\/avinton.com\/en\/#website","url":"https:\/\/avinton.com\/en\/","name":"Avinton Japan","description":"Tailored Solutions and Consulting in AI and Big Data","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/avinton.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/pages\/1942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/comments?post=1942"}],"version-history":[{"count":9,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/pages\/1942\/revisions"}],"predecessor-version":[{"id":82726,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/pages\/1942\/revisions\/82726"}],"up":[{"embeddable":true,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/pages\/1906"}],"wp:attachment":[{"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/media?parent=1942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/categories?post=1942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/avinton.com\/en\/wp-json\/wp\/v2\/tags?post=1942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}