{"id":89110,"date":"2020-07-18T19:42:10","date_gmt":"2020-07-18T17:42:10","guid":{"rendered":"https:\/\/prohoster.info\/blog\/administrirovanie\/obshhij-obzor-arhitektury-servisa-dlya-oczenki-vneshnosti-na-osnove-nejronnyh-setej"},"modified":"2020-07-18T19:42:10","modified_gmt":"2020-07-18T17:42:10","slug":"obshhij-obzor-arhitektury-servisa-dlya-oczenki-vneshnosti-na-osnove-nejronnyh-setej","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/obshhij-obzor-arhitektury-servisa-dlya-oczenki-vneshnosti-na-osnove-nejronnyh-setej","title":{"rendered":"P\u00ebrmbledhje e p\u00ebrgjithshme e arkitektur\u00ebs s\u00eb sh\u00ebrbimit p\u00ebr vler\u00ebsimin e pamjes n\u00eb baz\u00eb t\u00eb rrjeteve neuronale","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"P\u00ebrmbledhje e p\u00ebrgjithshme e arkitektur\u00ebs s\u00eb sh\u00ebrbimit p\u00ebr vler\u00ebsimin e pamjes n\u00eb baz\u00eb t\u00eb rrjeteve neuronale\" src=\"\/wp-content\/uploads\/2020\/07\/f624e995fbee3496f1f7890b98106df4.png\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<h2>Hyrje<\/h2>\n<p><\/p>\n<p>\ud83e\udd47Si t\u00eb arrish n\u00eb qiell dhe t\u00eb b\u00ebhesh pilot | ProHoster<\/p>\n<p><\/p>\n<p>N\u00eb k\u00ebt\u00eb artikull do t\u00eb ndaj p\u00ebrvoj\u00ebn time n\u00eb nd\u00ebrtimin e nj\u00eb arkitekture mikro-sh\u00ebrbimesh p\u00ebr nj\u00eb projekt q\u00eb p\u00ebrdor rrjete nervore.<\/p>\n<p><\/p>\n<p>Do t\u00eb flasim rreth k\u00ebrkesave t\u00eb arkitektur\u00ebs, do t\u00eb shohim diagramet e ndryshme strukturore, do t\u00eb shqyrtojm\u00eb \u00e7do komponent t\u00eb arkitektur\u00ebs s\u00eb gatshme dhe do t\u00eb vler\u00ebsojm\u00eb metrikat teknike t\u00eb zgjidhjes.<\/p>\n<p><\/p>\n<p>Lexim t\u00eb k\u00ebndsh\u00ebm!<\/p>\n<p><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h2>P\u00ebr disa fjal\u00eb rreth detyr\u00ebs dhe zgjidhjes s\u00eb saj<\/h2>\n<p><\/p>\n<p>Ideja kryesore \u00ebsht\u00eb q\u00eb, n\u00eb baz\u00eb t\u00eb fotove, t\u00eb japim nj\u00eb vler\u00ebsim t\u00eb atraktivitetit t\u00eb personit n\u00eb nj\u00eb shkall\u00eb nga 1 n\u00eb 10.<\/p>\n<p><\/p>\n<p>N\u00eb k\u00ebt\u00eb artikull ne do t\u00eb largohemi nga p\u00ebrshkrimi i rrjeteve nervore q\u00eb p\u00ebrdoren dhe procesit t\u00eb p\u00ebrgatitjes s\u00eb t\u00eb dh\u00ebnave dhe trajnimit. Megjithat\u00eb, n\u00eb nj\u00eb nga publikimet e ardhshme, ne do t\u00eb kthehemi me siguri n\u00eb shqyrtimin e pipeline-it t\u00eb vler\u00ebsimit n\u00eb nj\u00eb nivel m\u00eb t\u00eb thell\u00eb.<\/p>\n<p><\/p>\n<p>Tani ne do t\u00eb kalojm\u00eb n\u00eb m\u00ebnyr\u00eb t\u00eb p\u00ebrgjithshme p\u00ebrmes pipeline-it t\u00eb vler\u00ebsimit, duke p\u00ebrqendruar v\u00ebmendjen n\u00eb nd\u00ebrveprimin e mikro-sh\u00ebrbimeve n\u00eb kontekstin e arkitektur\u00ebs s\u00eb p\u00ebrgjithshme t\u00eb projektit.\u00a0<\/p>\n<p><\/p>\n<p>Gjat\u00eb pun\u00ebs mbi pipeline-in e vler\u00ebsimit t\u00eb atraktivitetit, detyra u dekompozua n\u00eb p\u00ebrb\u00ebr\u00ebsit n\u00eb vijim:<\/p>\n<p><\/p>\n<ol>\n<li>Identifikimi i fytyrave n\u00eb foto<\/li>\n<li>Vler\u00ebsimi i secil\u00ebs nga fytyrat<\/li>\n<li>Renderimi i rezultatit<\/li>\n<\/ol>\n<p><\/p>\n<p>E para zgjidhet me ndihm\u00ebn e <noindex><a rel=\"nofollow\" href=\"https:\/\/arxiv.org\/abs\/1604.02878\">MTCNN<\/a><\/noindex>. P\u00ebr t\u00eb dyt\u00ebn, nj\u00eb rrjet nervor konvulucional u trajnuar n\u00eb PyTorch, duke p\u00ebrdorur si backbone <noindex><a rel=\"nofollow\" href=\"https:\/\/arxiv.org\/abs\/1512.03385\">ResNet34<\/a><\/noindex> \u2013 nga balanca \"cil\u00ebsi \/ shpejt\u00ebsi inferenc\u00ebs n\u00eb CPU\"<\/p>\n<p>\n<img decoding=\"async\" alt=\"P\u00ebrmbledhje e p\u00ebrgjithshme e arkitektur\u00ebs s\u00eb sh\u00ebrbimit p\u00ebr vler\u00ebsimin e pamjes n\u00eb baz\u00eb t\u00eb rrjeteve neuronale\" src=\"\/wp-content\/uploads\/2020\/07\/181cc89a2cf5295bdcd4b838216f96d6.png\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><i>Diagrami funksional i pipeline-it t\u00eb vler\u00ebsimit<\/i><\/p>\n<p><\/p>\n<h2>Analiza e k\u00ebrkesave p\u00ebr arkitektur\u00ebn e projektit<\/h2>\n<p><\/p>\n<p>N\u00eb ciklin e jet\u00ebs <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Machine_learning\">ML<\/a><\/noindex> e projektit, etapet e pun\u00ebs mbi arkitektur\u00ebn dhe automatizimin e vendosjes s\u00eb modelit jan\u00eb shpesh nga m\u00eb t\u00eb shtrenjtat n\u00eb koh\u00eb dhe burime.<\/p>\n<p>\n<img decoding=\"async\" alt=\"P\u00ebrmbledhje e p\u00ebrgjithshme e arkitektur\u00ebs s\u00eb sh\u00ebrbimit p\u00ebr vler\u00ebsimin e pamjes n\u00eb baz\u00eb t\u00eb rrjeteve neuronale\" src=\"\/wp-content\/uploads\/2020\/07\/4949f217d31c863176122ed87b43a88c.png\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><i>Cikli i jet\u00ebs s\u00eb projektit ML<\/i><\/p>\n<p><\/p>\n<p>Ky projekt nuk \u00ebsht\u00eb p\u00ebrjashtim \u2013 u vendos q\u00eb pipeline-i i vler\u00ebsimit t\u00eb paketoj\u00eb si nj\u00eb sh\u00ebrbim online, p\u00ebr k\u00ebt\u00eb ishte e nevojshme t\u00eb thellohemi n\u00eb arkitektur\u00eb. K\u00ebto ishin disa k\u00ebrkesa baz\u00eb t\u00eb identifikuara:<\/p>\n<p><\/p>\n<ol>\n<li>Nj\u00eb repository t\u00eb vetme p\u00ebr log-e \u2013 t\u00eb gjith\u00eb sh\u00ebrbimet duhet t\u00eb shkruajn\u00eb log-e n\u00eb nj\u00eb vend, dhe t\u00eb jet\u00eb e leht\u00eb p\u00ebr t'i analizuar ato<\/li>\n<li>Mund\u00ebsia e shkall\u00ebzimit horizontal t\u00eb sh\u00ebrbimit t\u00eb vler\u00ebsimit \u2014 si ngushtic\u00eb m\u00eb e mundshme<\/li>\n<li>P\u00ebr \u00e7do imazh duhet t\u00eb ndahen t\u00eb nj\u00ebjtat burime t\u00eb procesorit \u2014 p\u00ebr t\u00eb shmangur shp\u00ebrthimet n\u00eb shp\u00ebrndarjen e koh\u00ebs p\u00ebr inferenc\u00ebn<\/li>\n<li>Zhvillim t\u00eb shpejt\u00eb (p\u00ebrs\u00ebritje) si t\u00eb sh\u00ebrbimeve specifike ashtu edhe t\u00eb stack-ut n\u00eb t\u00ebr\u00ebsi<\/li>\n<li>Mund\u00ebsia, n\u00ebse \u00ebsht\u00eb e nevojshme, p\u00ebr t\u00eb p\u00ebrdorur objekte t\u00eb p\u00ebrbashk\u00ebta n\u00eb sh\u00ebrbime t\u00eb ndryshme<\/li>\n<\/ol>\n<p><\/p>\n<h2>Arkitektura<\/h2>\n<p><\/p>\n<p>Pas analizimit t\u00eb k\u00ebrkesave, b\u00ebhet e qart\u00eb se arkitektura mikrosh\u00ebrbimeve p\u00ebrshtatet praktikisht perfekt.<\/p>\n<p><\/p>\n<p>P\u00ebr t\u00eb eliminuar ndonj\u00eb dhimbje t\u00eb panevojshme, u zgjodh Telegram API si frontend.<\/p>\n<p><\/p>\n<p>Fillimisht, le t\u00eb shqyrtojm\u00eb diagramin strukturore t\u00eb arkitektur\u00ebs p\u00ebrfundimtare, pastaj do t\u00eb kalojm\u00eb n\u00eb p\u00ebrshkrimin e secilit nga komponent\u00ebt, si dhe do t\u00eb formalisht procesin e p\u00ebrpunimit t\u00eb suksessh\u00ebm t\u00eb imazhit.<\/p>\n<p>\n<img decoding=\"async\" alt=\"P\u00ebrmbledhje e p\u00ebrgjithshme e arkitektur\u00ebs s\u00eb sh\u00ebrbimit p\u00ebr vler\u00ebsimin e pamjes n\u00eb baz\u00eb t\u00eb rrjeteve neuronale\" src=\"\/wp-content\/uploads\/2020\/07\/163ec019341e9d71a1e0854c6026bd01.png\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><i>Diagrami strukturore i arkitektur\u00ebs p\u00ebrfundimtare<\/i><\/p>\n<p><\/p>\n<p>T\u00eb flasim m\u00eb n\u00eb detaje p\u00ebr secilin nga komponent\u00ebt e diagramit, t\u00eb sh\u00ebnojm\u00eb p\u00ebrgjegj\u00ebsin\u00eb e tyre t\u00eb Vetme n\u00eb procesin e vler\u00ebsimit t\u00eb imazhit.<\/p>\n<p><\/p>\n<h3>Mikrosherbimi \u00abattrai-telegram-bot\u00bb<\/h3>\n<p><\/p>\n<p>Ky mikrosherbim inkapsulon t\u00eb gjitha nd\u00ebrveprimet me Telegram API. Mund t\u00eb ve\u00e7ojm\u00eb 2 skenar\u00eb kryesor\u00eb - puna me imazhin e p\u00ebrdoruesit dhe puna me rezultatin e pipeline-it t\u00eb vler\u00ebsimit. T\u00eb dy scenar\u00ebt do t'i shqyrtojm\u00eb n\u00eb m\u00ebnyr\u00eb t\u00eb p\u00ebrgjithshme.<\/p>\n<p><\/p>\n<p>Kur merret nj\u00eb mesazh nga p\u00ebrdoruesi me imazhin:<\/p>\n<p><\/p>\n<ol>\n<li>Kryhet filtrimi, q\u00eb p\u00ebrfshin verifikimet e m\u00ebposhtme:\n<ul>\n<li>Prania e madh\u00ebsis\u00eb optimale t\u00eb imazhit<\/li>\n<li>Numri i imazheve t\u00eb p\u00ebrdoruesit, q\u00eb tashm\u00eb jan\u00eb n\u00eb radh\u00eb<\/li>\n<\/ul>\n<\/li>\n<li>Pas kalimit t\u00eb filtrimit fillestar, imazhi ruhet n\u00eb volumet docker<\/li>\n<li>Nj\u00eb detyr\u00eb e prodhuar d\u00ebrgohet n\u00eb radha \u201cto_estimate\u201d, e cila p\u00ebrfshin, midis t\u00eb tjerash, rrug\u00ebn p\u00ebr n\u00eb imazhin q\u00eb ndodhet n\u00eb volumet ton\u00eb<\/li>\n<li>N\u00ebse etapet e lartp\u00ebrmendura kalohen me sukses - p\u00ebrdoruesi do t\u00eb marr\u00eb nj\u00eb mesazh me nj\u00eb koh\u00eb t\u00eb p\u00ebraf\u00ebrt p\u00ebr p\u00ebrpunimin e imazhit, e cila llogaritet mbi numrin e detyrave n\u00eb radh\u00eb. N\u00eb rast gabimi, p\u00ebrdoruesi do t\u00eb informohet qart\u00eb p\u00ebr k\u00ebt\u00eb - duke d\u00ebrguar nj\u00eb mesazh me informacion se \u00e7far\u00eb mund t\u00eb ket\u00eb shkuar keq. <\/li>\n<\/ol>\n<p><\/p>\n<p>Gjithashtu, ky mikrosherbim, si punonj\u00ebs celery, d\u00ebgjon radh\u00ebn \u201cafter_estimate\u201d, e cila \u00ebsht\u00eb e destinuar p\u00ebr detyrat q\u00eb kan\u00eb kaluar p\u00ebrmes pipeline-it t\u00eb vler\u00ebsimit.<\/p>\n<p><\/p>\n<p>Kur merret nj\u00eb detyr\u00eb e re nga \u201cafter_estimate\u201d:<\/p>\n<p><\/p>\n<ol>\n<li>N\u00ebse imazhi \u00ebsht\u00eb p\u00ebrpunuar me sukses \u2013 d\u00ebrgojm\u00eb rezultatin p\u00ebrdoruesit, n\u00ebse jo \u2013 e njoftojm\u00eb p\u00ebr gabimin<\/li>\n<li>Fshijm\u00eb imazhin, q\u00eb \u00ebsht\u00eb rezultati i pipeline-it t\u00eb vler\u00ebsimit<\/li>\n<\/ol>\n<p><\/p>\n<h3>Mikrosherbimi i vler\u00ebsimit \u00abattrai-estimator\u00bb<\/h3>\n<p><\/p>\n<p>Ky mikrosherbim \u00ebsht\u00eb nj\u00eb punonj\u00ebs celery dhe inkapsulon gjith\u00e7ka q\u00eb lidhet me pipeline-in e vler\u00ebsimit t\u00eb imazhit. Algoritmi i pun\u00ebs k\u00ebtu \u00ebsht\u00eb i vetmi - do ta shqyrtojm\u00eb at\u00eb.<\/p>\n<p><\/p>\n<p>Kur merret nj\u00eb detyr\u00eb e re nga \u201cto_estimate\u201d:<\/p>\n<p><\/p>\n<ol>\n<li>P\u00ebrshkruajm\u00eb imazhin p\u00ebrmes pipeline-it t\u00eb vler\u00ebsimit:\n<ol>\n<li>Ngarko imazhin n\u00eb memorje<\/li>\n<li>Bring the image to the desired size<\/li>\n<li>Find all faces (MTCNN)<\/li>\n<li>Evaluate all faces (wrap faces found in the previous step into a batch and infer using ResNet34)<\/li>\n<li>Render the final image\n<ol>\n<li>Draw bounding boxes<\/li>\n<li>Draw evaluations<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li>Delete the user\u2019s (original) image<\/li>\n<li>Save the output from the evaluation pipeline<\/li>\n<li>Place the task in the \u2018after_estimate\u2019 queue, which is listened to by the previously discussed microservice \u2018attrai-telegram-bot\u2019<\/li>\n<\/ol>\n<p><\/p>\n<h3>Graylog (+ mongoDB + Elasticsearch)<\/h3>\n<p><\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/www.graylog.org\/\">Graylog<\/a><\/noindex> \u2014 is a solution for centralized log management. In this project, it was used for its intended purpose.<\/p>\n<p><\/p>\n<p>The choice fell specifically on it, rather than the familiar <noindex><a rel=\"nofollow\" href=\"https:\/\/www.elastic.co\/what-is\/elk-stack\">ELK<\/a><\/noindex> stack, due to the convenience of working with it from Python. All that is needed to log in Graylog is to add GELFTCPHandler from the <noindex><a rel=\"nofollow\" href=\"https:\/\/pypi.org\/project\/graypy\/\">graypy<\/a><\/noindex> to other root logger handlers of our python microservice.<\/p>\n<p><\/p>\n<p>As someone who has previously only worked with the ELK stack, I generally had a positive experience working with Graylog. The only downside is Kibana\u2019s superior features compared to Graylog\u2019s web interface.<\/p>\n<p><\/p>\n<h3>RabbitMQ<\/h3>\n<p><\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/www.rabbitmq.com\/\">RabbitMQ<\/a><\/noindex> \u2014 is a message broker based on the AMQP protocol.<\/p>\n<p><\/p>\n<p>In this project, it was used as <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.celeryproject.org\/en\/latest\/getting-started\/brokers\/#broker-overview\">the most stable and time-tested<\/a><\/noindex> broker for Celery and operated in durable mode.<\/p>\n<p><\/p>\n<h3>Redis<\/h3>\n<p><\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/redis.io\/\">Redis<\/a><\/noindex> \u2014 is a NoSQL DBMS that works with key-value data structures.<\/p>\n<p><\/p>\n<p>Sometimes it's necessary to use common objects in different python microservices that implement some data structures.<\/p>\n<p><\/p>\n<p>For example, Redis stores a hashmap like \u2018telegram_user_id =&gt; number of active tasks in the queue\u2019, which allows limiting the number of requests from a single user to a certain value, thereby preventing DoS attacks.<\/p>\n<p><\/p>\n<h3>Formalize the process of successful image processing<\/h3>\n<p><\/p>\n<ol>\n<li>The user sends an image to the Telegram bot<\/li>\n<li>\u2018attrai-telegram-bot\u2019 receives a message from the Telegram API and parses it<\/li>\n<li>The task with the image is added to the asynchronous queue \u2018to_estimate\u2019<\/li>\n<li>The user receives a message with the planned estimation time<\/li>\n<li>\u2018attrai-estimator\u2019 takes the task from the \u2018to_estimate\u2019 queue, runs it through the evaluation pipeline, and produces a task in the \u2018after_estimate\u2019 queue<\/li>\n<li>\u2018attrai-telegram-bot\u2019, listening to the \u2018after_estimate\u2019 queue, sends the result to the user<\/li>\n<\/ol>\n<p><\/p>\n<h2>DevOps<\/h2>\n<p><\/p>\n<p>Finally, after reviewing the architecture, we can move on to the equally interesting part \u2014 DevOps<\/p>\n<p><\/p>\n<h3>Docker Swarm<\/h3>\n<p><\/p>\n<p>\u00a0<\/p>\n<p>\n<img decoding=\"async\" alt=\"P\u00ebrmbledhje e p\u00ebrgjithshme e arkitektur\u00ebs s\u00eb sh\u00ebrbimit p\u00ebr vler\u00ebsimin e pamjes n\u00eb baz\u00eb t\u00eb rrjeteve neuronale\" src=\"\/wp-content\/uploads\/2020\/07\/ba539d1c8197c7961d6e5e6a5c7e83c6.png\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/docs.docker.com\/engine\/swarm\/\">Docker Swarm <\/a><\/noindex>\u00a0\u2014 nj\u00eb sistem klasterimi, funksionaliteti i t\u00eb cilit \u00ebsht\u00eb realizuar brenda Docker Engine dhe \u00ebsht\u00eb i disponuesh\u00ebm nga kutia.<\/p>\n<p><\/p>\n<p>Me ndihm\u00ebn e \u00abrojeve\u00bb, t\u00eb gjith\u00eb nodet e klasterit ton\u00eb mund t\u00eb ndahen n\u00eb 2 lloje \u2013 punonj\u00ebs dhe menaxher. N\u00eb pajisjet e llojit t\u00eb par\u00eb krijohen grupe kontejner\u00ebsh (stacks), pajisjet e llojit t\u00eb dyt\u00eb jan\u00eb p\u00ebrgjegj\u00ebse p\u00ebr shkall\u00ebzimin, balancimin dhe <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.docker.com\/engine\/swarm\/#feature-highlights\">karakteristika t\u00eb tjera t\u00eb shk\u00eblqyera<\/a><\/noindex>. Menaxher\u00ebt p\u00ebr default jan\u00eb gjithashtu punonj\u00ebs.<\/p>\n<p>\n<img decoding=\"async\" alt=\"P\u00ebrmbledhje e p\u00ebrgjithshme e arkitektur\u00ebs s\u00eb sh\u00ebrbimit p\u00ebr vler\u00ebsimin e pamjes n\u00eb baz\u00eb t\u00eb rrjeteve neuronale\" src=\"\/wp-content\/uploads\/2020\/07\/d195e2aab6d3552652102c2b5246abfc.png\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><i>Nj\u00eb klaster me nj\u00eb menaxher lider dhe tre punonj\u00ebs<\/i><\/p>\n<p><\/p>\n<p>Madh\u00ebsia minimale e mundshme e klasterit \u00ebsht\u00eb 1 nod, pajisja e vetme do t\u00eb veproj\u00eb nj\u00ebkoh\u00ebsisht si menaxher lider dhe punonj\u00ebs. Duke u bazuar n\u00eb madh\u00ebsin\u00eb e projektit dhe k\u00ebrkesat minimale p\u00ebr q\u00ebndrueshm\u00ebri, u mor vendimi p\u00ebr t\u00eb p\u00ebrdorur k\u00ebt\u00eb qasje.<\/p>\n<p><\/p>\n<p>Duke e kaluar p\u00ebrpara, do t\u00eb them se q\u00eb nga shp\u00ebrndarja e par\u00eb n\u00eb prodhim, e cila ndodhi n\u00eb mes t\u00eb qershorit, nuk ka pasur probleme t\u00eb lidhura me organizimin e k\u00ebtij klasteri (por kjo nuk do t\u00eb thot\u00eb se nj\u00eb organizim i till\u00eb \u00ebsht\u00eb i pranuesh\u00ebm n\u00eb ndonj\u00eb projekt t\u00eb mes\u00ebm ose t\u00eb madh q\u00eb ka k\u00ebrkesa p\u00ebr q\u00ebndrueshm\u00ebri).<\/p>\n<p><\/p>\n<h3>Docker Stack<\/h3>\n<p><\/p>\n<p>N\u00eb modin e \u00abrojeve\u00bb p\u00ebr shp\u00ebrndarjen e stacks (grupimi i sh\u00ebrbimeve docker) \u00ebsht\u00eb p\u00ebrgjegj\u00ebs <noindex><a rel=\"nofollow\" href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/stack\/\">docker stack<\/a><\/noindex><\/p>\n<p><\/p>\n<p>Ai mb\u00ebshtet konfigurime docker-compose, duke lejuar p\u00ebrdorimin e parametrave t\u00eb deploy-it p\u00ebr m\u00eb tep\u00ebr.\u00a0\u00a0<\/p>\n<p><\/p>\n<p>P\u00ebr shembull, me ndihm\u00ebn e k\u00ebtyre parametrave u kufizuan burimet p\u00ebr secil\u00ebn nga instancat e mikrosh\u00ebrbimit t\u00eb vler\u00ebsimit (ndajm\u00eb N qarqe p\u00ebr N instanca, n\u00eb vet\u00eb mikrosh\u00ebrbimin kufizojm\u00eb numrin e qarqeve t\u00eb p\u00ebrdorura nga PyTorch n\u00eb nj\u00eb)<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">attrai_estimator:\n  image: 'erqups\/attrai_estimator:1.2'\n  deploy:\n    replicas: 4\n    resources:\n      limits:\n        cpus: '4'\n    restart_policy:\n      condition: on-failure\n      \u2026<\/code><\/pre>\n<p><\/p>\n<p>\u00cbsht\u00eb e r\u00ebnd\u00ebsishme t\u00eb theksohet se Redis, RabbitMQ dhe Graylog jan\u00eb sh\u00ebrbime stateful dhe nuk \u00ebsht\u00eb aq e leht\u00eb t'i shkall\u00ebzojm\u00eb ato si \u00abattrai-estimator\u00bb<\/p>\n<p><\/p>\n<h3>Duke parashikuar pyetjen\u2014pse jo Kubernetes?<\/h3>\n<p><\/p>\n<p>Duket se p\u00ebrdorimi i Kubernetes n\u00eb projekte t\u00eb vogla dhe t\u00eb mesme \u00ebsht\u00eb nj\u00eb overhed, t\u00eb gjitha funksionalitetet e nevojshme mund t\u00eb merren nga Docker Swarm, i cili \u00ebsht\u00eb mjaft miq\u00ebsor me p\u00ebrdoruesit si nj\u00eb orkestrator kontejner\u00ebsh, si dhe ka nj\u00eb prag t\u00eb ul\u00ebt hyr\u00ebs.<\/p>\n<p><\/p>\n<h3>Infrastruktura<\/h3>\n<p><\/p>\n<p>T\u00eb gjitha k\u00ebto u zhvilluan n\u00eb VDS me karakteristika t\u00eb m\u00ebposhtme:<\/p>\n<p><\/p>\n<ul>\n<li>CPU: 4 b\u00ebrtham\u00eb Intel\u00ae Xeon\u00ae Gold 5120 CPU @ 2.20GHz<\/li>\n<li>RAM: 8 GB<\/li>\n<li>SSD: 160 GB<\/li>\n<\/ul>\n<p><\/p>\n<p>Pas testeve lokale t\u00eb ngarkes\u00ebs, dukej se gjat\u00eb nj\u00eb fluksi t\u00eb r\u00ebnd\u00eb p\u00ebrdoruesish, kjo pajisje do t\u00eb ishte n\u00eb kufi.<\/p>\n<p><\/p>\n<p>Por vet\u00ebm pas implementimit, kam postuar nj\u00eb lidhje n\u00eb nj\u00eb nga board-et m\u00eb t\u00eb njohura t\u00eb imazheve n\u00eb CIS (po, at\u00eb t\u00eb famshmen), pas s\u00eb cil\u00ebs njer\u00ebzit u interesuan dhe brenda disa or\u00ebve sh\u00ebrbimi p\u00ebrpunoi me sukses dhjet\u00ebra mij\u00ebra imazhe. N\u00eb momentet kulmore, burimet CPU dhe RAM nuk u shfryt\u00ebzuan as n\u00eb gjysm\u00ebn e kapacitetit.<\/p>\n<p>\n<img decoding=\"async\" alt=\"P\u00ebrmbledhje e p\u00ebrgjithshme e arkitektur\u00ebs s\u00eb sh\u00ebrbimit p\u00ebr vler\u00ebsimin e pamjes n\u00eb baz\u00eb t\u00eb rrjeteve neuronale\" src=\"\/wp-content\/uploads\/2020\/07\/458d74dae00d455fbce1ca6a197325d7.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<img decoding=\"async\" alt=\"P\u00ebrmbledhje e p\u00ebrgjithshme e arkitektur\u00ebs s\u00eb sh\u00ebrbimit p\u00ebr vler\u00ebsimin e pamjes n\u00eb baz\u00eb t\u00eb rrjeteve neuronale\" src=\"\/wp-content\/uploads\/2020\/07\/e9383c47369c606d26e89a69f4d22b5a.png\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<h3>Pak m\u00eb shum\u00eb grafik\u00eb<\/h3>\n<p><\/p>\n<p>Numri i p\u00ebrdoruesve unik\u00eb dhe k\u00ebrkesave p\u00ebr vler\u00ebsim, q\u00eb nga momenti i implementimit, varion sipas dit\u00ebs<\/p>\n<p>\n<img decoding=\"async\" alt=\"P\u00ebrmbledhje e p\u00ebrgjithshme e arkitektur\u00ebs s\u00eb sh\u00ebrbimit p\u00ebr vler\u00ebsimin e pamjes n\u00eb baz\u00eb t\u00eb rrjeteve neuronale\" src=\"\/wp-content\/uploads\/2020\/07\/7112c78c8400d2ac73562243b16a015b.png\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p>Distribucioni i koh\u00ebs s\u00eb inferenc\u00ebs s\u00eb pipeline-it t\u00eb vler\u00ebsimit<\/p>\n<p>\n<img decoding=\"async\" alt=\"P\u00ebrmbledhje e p\u00ebrgjithshme e arkitektur\u00ebs s\u00eb sh\u00ebrbimit p\u00ebr vler\u00ebsimin e pamjes n\u00eb baz\u00eb t\u00eb rrjeteve neuronale\" src=\"\/wp-content\/uploads\/2020\/07\/4c892ce607c3ff3db466459729dd0876.png\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<h2>P\u00ebrfundimet<\/h2>\n<p><\/p>\n<p>N\u00eb p\u00ebrmbledhje, mund t\u00eb them se arkitektura dhe qasja p\u00ebr orkestrimin e kontejner\u00ebve e justifikuan vetveten plot\u00ebsisht \u2014 edhe n\u00eb momentet kulmore nuk kishte r\u00ebnie dhe vonesa n\u00eb koh\u00ebn e p\u00ebrpunimit.\u00a0<\/p>\n<p><\/p>\n<p>Mendoj q\u00eb projektet e vogla dhe t\u00eb mesme, q\u00eb p\u00ebrdorin inferenc\u00ebn n\u00eb koh\u00eb reale t\u00eb rrjeteve neuronale n\u00eb CPU, mund t\u00eb p\u00ebrfitojn\u00eb suksessh\u00ebm nga praktikat e p\u00ebrshkruara n\u00eb k\u00ebt\u00eb artikull.<\/p>\n<p><\/p>\n<p>Do t\u00eb shtoja se fillimisht artikulli ishte m\u00eb i gjat\u00eb, por, p\u00ebr t\u00eb mos postuar nj\u00eb dokument t\u00eb gjat\u00eb, vendosa t\u00eb l\u00eb disa pika jasht\u00eb \u2014 do t\u00eb kthehemi te to n\u00eb publikime t\u00eb ardhshme.<\/p>\n<p><\/p>\n<p>Mund ta provoni botin n\u00eb Telegram \u2014 @AttraiBot, do t\u00eb funksionoj\u00eb, t\u00eb pakt\u00ebn, deri n\u00eb fund t\u00eb vjesht\u00ebs s\u00eb vitit 2020. Kujtoj \u2014 nuk ruhet asnj\u00eb t\u00eb dh\u00ebn\u00eb personale \u2014 as imazhet origjinale, as rezultatet e pipeline-it t\u00eb vler\u00ebsimit \u2014 gjith\u00e7ka fshihet pas p\u00ebrpunimit.<\/p>\n<p>Burimi: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/511332\/\">habr.com<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u041f\u0440\u0438\u0432\u0435\u0442! \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u043e\u043f\u044b\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438. \u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u043a \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b, \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0446\u0435\u043d\u0438\u043c \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u041f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f! \u041f\u0430\u0440\u0443 \u0441\u043b\u043e\u0432 \u043e \u0437\u0430\u0434\u0430\u0447\u0435 \u0438 \u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u2013 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0444\u043e\u0442\u043e \u0434\u0430\u0442\u044c \u043e\u0446\u0435\u043d\u043a\u0443 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":89111,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-89110","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2.1 - aioseo.com -->\n\t<meta name=\"description\" content=\".\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/obshhij-obzor-arhitektury-servisa-dlya-oczenki-vneshnosti-na-osnove-nejronnyh-setej\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"sq_AL\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041e\u0431\u0449\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0432\u043d\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\".\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/obshhij-obzor-arhitektury-servisa-dlya-oczenki-vneshnosti-na-osnove-nejronnyh-setej\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-07-18T17:42:10+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-07-18T17:42:10+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47P\u00ebrmbledhje e p\u00ebrgjithshme e arkitektur\u00ebs s\u00eb sh\u00ebrbimit p\u00ebr vler\u00ebsimin e dukshm\u00ebris\u00eb bazuar n\u00eb rrjetet neuronale | ProHoster","description":".","canonical_url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/obshhij-obzor-arhitektury-servisa-dlya-oczenki-vneshnosti-na-osnove-nejronnyh-setej","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sq_AL","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041e\u0431\u0449\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0432\u043d\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 | ProHoster","og:description":".","og:url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/obshhij-obzor-arhitektury-servisa-dlya-oczenki-vneshnosti-na-osnove-nejronnyh-setej","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-07-18T17:42:10+00:00","article:modified_time":"2020-07-18T17:42:10+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"89110","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 13:16:27","updated":"2022-09-29 06:10:39","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/89110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/comments?post=89110"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/89110\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media\/89111"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media?parent=89110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/categories?post=89110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/tags?post=89110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}