<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vijay Bhaskar</title>
    <description>The latest articles on DEV Community by Vijay Bhaskar (@vijjusri14).</description>
    <link>https://dev.to/vijjusri14</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F71129%2F449edbe5-93a9-4237-8063-ca1982eb010c.jpeg</url>
      <title>DEV Community: Vijay Bhaskar</title>
      <link>https://dev.to/vijjusri14</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vijjusri14"/>
    <language>en</language>
    <item>
      <title>Batch generate YouTube playlist thumbnails with custom text using Python</title>
      <dc:creator>Vijay Bhaskar</dc:creator>
      <pubDate>Tue, 28 Dec 2021 07:27:58 +0000</pubDate>
      <link>https://dev.to/vijjusri14/batch-generate-youtube-playlist-thumbnails-with-custom-text-using-python-5f06</link>
      <guid>https://dev.to/vijjusri14/batch-generate-youtube-playlist-thumbnails-with-custom-text-using-python-5f06</guid>
      <description>&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/vijjusri14" rel="noopener noreferrer"&gt;
        vijjusri14
      &lt;/a&gt; / &lt;a href="https://github.com/vijjusri14/posterMark" rel="noopener noreferrer"&gt;
        posterMark
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Batch generate posters with custom text
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Batch generate posters with custom text&lt;/p&gt;

&lt;p&gt;Useful to generate YouTube playlist thumbnails&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fvijjusri14%2FposterMark%2Fmain%2FSample.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fvijjusri14%2FposterMark%2Fmain%2FSample.png" alt="Sample" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Folder Structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;assets  
│
└─── fonts
│       Satisfy.ttf
│       ShadowIntoLight.ttf
│
└─── images
        poster.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Place your TrueTypeFonts in the fonts directory and background images in the images directory&lt;/p&gt;

&lt;h2&gt;
  
  
  Settings
&lt;/h2&gt;

&lt;p&gt;Update &lt;em&gt;settings.json&lt;/em&gt; to customize the output&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "OutputPath": "out",
    "ImagesPath": "./assets/images/",
    "BackgroundImage": "poster.png",
    "FontsPath": "./assets/fonts/",
    "Title": {
        "Font": "ShadowsIntoLight.ttf",
        "Size": 300,
        "Color": "(254, 27, 28)",
        "Position": "(100, 50)"
    },
    "Subtitle": {
        "Font": "Satisfy.ttf",
        "Size": 150,
        "Color": "(85, 30, 138)",
        "Position": "(100, 500)"
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also change the background image, title and subtitle fonts&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;color&lt;/em&gt; is represented by (R, G, B) values and &lt;em&gt;position&lt;/em&gt; by (X, Y)&lt;/p&gt;

&lt;p&gt;The fonts used here are &lt;a href="https://fonts.google.com/specimen/Satisfy" rel="noopener noreferrer"&gt;Satisfy&lt;/a&gt; and &lt;a href="https://fonts.google.com/specimen/Shadows+Into+Light" rel="noopener noreferrer"&gt;ShadowsIntoLight&lt;/a&gt; from Google fonts&lt;/p&gt;

&lt;h2&gt;
  
  
  Posters
&lt;/h2&gt;

&lt;p&gt;Update &lt;em&gt;fileList.json&lt;/em&gt; to specify the titles and subtitles for the posters&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "Sample": {
    "Title": "PosterMark",
    "Subtitle": "Batch generate posters with custom text"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Key of the each json object will be the file name of the poster. Here in the above example, the file name will be &lt;em&gt;Sample.png&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;Install &lt;a href="https://www.python.org/downloads/" rel="noopener noreferrer"&gt;Python3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clone &lt;a href="https://github.com/vijjusri14/posterMark" rel="noopener noreferrer"&gt;this&lt;/a&gt; repository&lt;/p&gt;

&lt;p&gt;Create a virtual environment(venv) in the cloned repository directory and activate the venv&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m venv .\venv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install pip packages&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install -r .\requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update &lt;em&gt;settings.json&lt;/em&gt; and &lt;em&gt;fileList.json&lt;/em&gt; as required&lt;/p&gt;

&lt;p&gt;Run python script&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python posterMark.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>pillow</category>
      <category>posters</category>
      <category>youtube</category>
    </item>
    <item>
      <title>An OpenAI Gym docker that can render on Windows</title>
      <dc:creator>Vijay Bhaskar</dc:creator>
      <pubDate>Tue, 28 Dec 2021 07:08:01 +0000</pubDate>
      <link>https://dev.to/vijjusri14/an-openai-gym-docker-that-can-render-on-windows-5g6c</link>
      <guid>https://dev.to/vijjusri14/an-openai-gym-docker-that-can-render-on-windows-5g6c</guid>
      <description>&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/vijjusri14" rel="noopener noreferrer"&gt;
        vijjusri14
      &lt;/a&gt; / &lt;a href="https://github.com/vijjusri14/OpenAI-Gym-Docker" rel="noopener noreferrer"&gt;
        OpenAI-Gym-Docker
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      An OpenAI Gym docker that can render on Windows
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;This image starts from the jupyter/tensorflow-notebook, and has atari_py installed. Therefore, many environments can be played.&lt;/p&gt;

&lt;p&gt;This image is made for running OpenAI Gym on Windows. But in general, it works on other OS like Linux, MacOS etc. as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/windows/wsl/install" rel="noopener noreferrer"&gt;Windows Subsystem for Linux WSL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.docker.com/products/docker-desktop" rel="noopener noreferrer"&gt;Docker Desktop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sourceforge.net/projects/vcxsrv/" rel="noopener noreferrer"&gt;VcXsrv Windows X Server&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="//./Dockerfile"&gt;Dockerfile&lt;/a&gt;: Dockerfile to build the OpenAI Gym image&lt;/li&gt;
&lt;li&gt;
&lt;a href="//./example"&gt;example&lt;/a&gt;: Some example notebooks for testing&lt;/li&gt;
&lt;li&gt;
&lt;a href="//./example/env_render.ipynb"&gt;example/env_render.ipynb&lt;/a&gt;: Test Gym environments rendering&lt;/li&gt;
&lt;li&gt;
&lt;a href="//./example/18_reinforcement_learning.ipynb"&gt;example/18_reinforcement_learning.ipynb&lt;/a&gt;: This is a copy from Chapter 18 in Géron, Aurélien's book: Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow.  Source code is &lt;a href="https://github.com/ageron/handson-ml2/blob/master/18_reinforcement_learning.ipynb" rel="noopener noreferrer"&gt;here&lt;/a&gt; in GitHub.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Build the image
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t openai_gym_docker:v1.0 .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create and run the instance of the container
&lt;/h2&gt;

&lt;p&gt;Get the Network InterfaceAlias name using the below command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;netsh interface ipv4 show interface
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Customize the number of CPUs and Memory in the below command according to your system specifications. Also update Network InterfaceAlias from previous command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -itd --name=openai-gym -p 8888:8888 --cpus='3' --memory='6g' --add-host=dockerhost:$(Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias 'Wi-Fi' | Select-Object -ExpandProperty 'IPAddress';) -e DISPLAY=dockerhost:0.0 openai_gym_docker:v1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Get Jupyter token
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker exec -it openai-gym bash -c 'jupyter notebook list'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the docker instance starts running, open browser and visit &lt;a href="http://localhost:8888" rel="noopener noreferrer"&gt;http://localhost:8888&lt;/a&gt; and login with the token from above.&lt;/p&gt;

&lt;p&gt;Jupyter will promt you to set new password for future logins.&lt;/p&gt;

&lt;p&gt;Create/Import Python Notebooks and start exploring Reinforcement Learning 🤖&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop the container
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker stop openai-gym
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Start the container
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker start openai-gym
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>openai</category>
      <category>docker</category>
      <category>python</category>
      <category>tensorflow</category>
    </item>
  </channel>
</rss>
