Tuesday, July 30, 2024

How do you work with image files in PyCharm - Part 1?

 Exploring image properties with PyCharm IDE

The image properties of a test image will be the target of our image exploration. In this part we create a project and bring in an image to the project.

Part 1: We create a PyCharm project and bring in an image into the project.

At first we create a new project in the PyCharm IDE. Here are some screenshots of creating a project.
File -> New Project brings up the next screen.


Change the name of the project to exploreImage.


Click create to create your project. You may get this screen. Choose New Window. Note that each project is usually window based. If you choose This Window, you will be adding the newly created project to another projects window.


Now imageExplore is the only project in the window that is open.


This is the default structure of a PyCharm project. It has a .venv directory and the main.py python program. This is the main entry point of the project. This has the initial logic and execution flow. It can be renamed and do not remove it. The .venv isolates your project and its dependencies from the other projects. The Scripts folder in .venv has many executable programs in addition to the python executable and other packages. You will learn a lot more about the project folder as we go through in due course.

Now we would like to create a new folder called Images wherein we place our images. It can be called in any way you choose to name.

Highlighting the exploreImage project a left click of the mouse brings up the following. Choose New -> Directory.


This should add a New Directory you can provide a custom name as shown.


However, the program does not create a new directory which it should. Even after exiting the PyCharm and reopening did not create the new directory.
Note: There  is some problem with PyCharm. However, we can create a directory using the file system in the Windows Explorer.







Monday, July 22, 2024

How do AI Chatbots fare with image creation?

We have seen that some of the chatGPT based chats (CoPilot,DALL-E 2, MidJourney, NightCafe  Creator, etc.) seem to work with both textual /image information. However, AI's interaction with text is lot more advanced than with the images. 

The difference between text, and image is analogous to structured data and unstructured data. Most of the textual information is highly ordered and structured, but that of the image is unstructured. Text may give a more intimate view into what it represents and it may even generate human-like text, but image gives only a give few of its attributes like shape, color, size and it may not be able to give the full context, like emotions. We can say at this point that text gives a higher contextual understanding than an image.

Image analysis using AI commonly known as computer vision has also made great advances but challenges are many. The probing of images by AI with research in deep learning and neural networks is narrowing this gap. Presently AI models are getting better at object detection, image recognition and generate images from text descriptions.

Here are some examples of images created from text:

Create a detailed picture of Ayodhya temple in India.

Co_Pilot tried to create an image. I am not showing all its attempts as they did not remotely resemble a Hindu temple but something from the fairy tales.

Here is what I finally got after goading:


This is one of the four images that are created automatically.

Well, Gemini tried as well but these are the results. I did not try repeated refinements of my text to get them.







Meta AI also tried its hand at creating the Ayodhya temple using it Emu, Meta Ai's proprietary engine.




The temple in India looks like this.


Presently, this is the best th ChatBots can do.

I do have an image from NightCafe and I will paste it here when I find it.

Monday, July 15, 2024

What do BlueStacks, Genymotion, Nox and LDPlayer have in common?

 Bluestacks 10 (https://www.bluestacks.com/download.html)app player allows you to play mobile apps, both Cloud Gaming and Android Emulator) from the Google Play Store on your Windows or Mac computer. 

Genymotion (https://www.genymotion.com/product-desktop/download/)is a cross platform Android emulator for testing apps. It can do scalable testing that are done on virtual devices.It is available for windows (x64), Linux(x64) and macOS(x86-64, arm64) platforms as well as Genymotion SaaS and Genymotion Device Image.


Nox (https://www.bignox.com/) is yet another Android Emulator for playing mobile games.


 LDPlayer (https://www.ldplayer.net/) featured as the fastest Emulator for Android games PC.' 





Motivation:

Actually, I wanted the raw data on a commercial, low cost, smartwatch from a Chinese company that called upon an Android app called HBand. H Band is available on Google Play, but if you want to run it on your windows PC (Windows 11) you need an Android Emulator. All of the above apps are indicated for the use of H Band.

The Mobile app, H Band on a Android Phone works OK. But, what if you want to look at raw data of  (body temperature, step counts, blood pressure, blood glucose, blood oxygen, Heart rate,and body temperature) collected by the app.It is supposed to be a safe app as far as data safety is considered including transit time encryption). 


BlueStack:


I contacted BlueStack to find that it does not yet support Bluetooth.


I tried Nox to connect to the watch. It works sometimes and sometimes it does not open. All these apps run very slow, intolerable in this 5G era.

GenyMotion requires a virtualBox. I wanted something that would work with no additional software.

LDPlayer is another option and it takes a lot of memory. It's Bluetooth connection is also not good.





I looked up the space requirements for some of these and they do take up a lot of space and send non-stop notifications.

This is what one of the ChatGPT came up with:

1. **BlueStacks 5**:

   - RAM: Requires at least 4GB of RAM¹.

   - Storage: Approximately 5GB of free disk space².

   - CPU Consumption: Consumes about 10% CPU, making it efficient¹.

   - RAM Usage: Consumes the least amount of RAM compared to other emulators¹.


2. **LDPlayer**:

   - CPU Consumption: Registered a massive 145% higher CPU usage compared to BlueStacks¹.

   - RAM Usage: Consumes more RAM than BlueStacks¹.


3. **Nox**:

   - CPU Consumption: Consumes 37% more CPU resources with noticeable lag in-app performance¹.

   - Storage: Unfortunately, I couldn't find specific storage requirements for Nox, but it seems to take up significant space³.


4. **Genymotion**:

   - Genymotion is another popular emulator, but its resource usage can vary based on the specific configuration and usage.


I DECIDED TO DUMP THEM ALL AND USE THE ANDROID EMULATOR IN ANDROID STUDIO. WHAT IS MORE, I HAD USED IT YEARS AGO.

NOT BEING A GAMER, I DO NOT NEED THE PROGRAMS. WHen I FIND SOME TIME, I WILL GET RID OF THEM





 







Sunday, July 14, 2024

What is a UTM in relation to Uniform Resource Locators?

UTMs  are a subset of URL parameters that are key-value pairs. The key-value pairs adds information and instructions to the URL.

UTM parameters are a specific format appended to a URL that track marketing campaign data in media sites like eCommerce sites or promotional media sites. They typically consist of five parts and all may not be present and even if present are not easily identified:

utm_source: Identifies the source of the traffic (e.g., google, email)

utm_medium: Identifies the advertising medium (e.g., cpc, organic)

utm_campaign: Identifies the specific marketing campaign

utm_term: Identifies the paid search term used (if applicable)

utm_content: Identifies the specific ad creative used (if applicable)

About URLs and UTMs

Hodentek.blogspot.com is my blog which brings up this:


One of the links at the bottom takes me, or directs me to

https://hodentekmobile.blogspot.com/2021/09/installing-android-studio-arctic-fox.html#google_vignette

So far we have had no URL parameters. The link just took us to another post in the blog.

In the following, the webpage brings https://www.amazon.com 

Searching for an author (myself) brings this page:


https://www.amazon.com/s?k=Jayaram+Krishnaswamy&crid=2BWW0UDS2F3NK&sprefix=jayaram+krishnaswamy%2Caps%2C195&ref=nb_sb_noss

There are URL parameters but are not UTMs. There are no UTM related key/value pairs. It is just a search page.

Here is an example of looking for a UTM page. Google places ads on the web pages and when it is clicked, the page author gets a click credit.

This is a blog page of mine with a coupon:


Click the Coupon code on this page to bring this one up:


Hitting CONTINUE will bring up this page with its URL shown below the image.


https://capitaloneshopping.com/lp/shoppingsavingscouponsm?utm_source=Unicorn&atnid=EAIaIQobChMIlaGV3P-nhwMVPlwIBB32wAB1EAEYASAAEgI3uPD_BwE

As shown in the highlighted key-value pairs you can recognize the UTM. The source 'UNICORN' is perhaps custom marketing campaign internal to the company. Media sites like Google, Facebook, etc are some examples of sources.

Another example:

https://topsearchesgo.net/1149?utm_source=zemanta&campaign_id=45129994&adset_id=60051870&ad_id=164414688&mediasource_id=b1_googleadx&publisher_id=hodentekhelp%2Eblogspot%2Ecom&placement=2161889362&click_id=63224_dde31108-431b-11ef-8da6-453632a452f2&zpbid=63224_dde31108-431b-11ef-8da6-453632a452f2

One more example from a Gold site:

https://topsearchesgo.net/1149?utm_source=zemanta&campaign_id=45129994&adset_id=60051870&ad_id=164415377&mediasource_id=b1_googleadx&publisher_id=hodentekhelp%2Eblogspot%2Ecom&placement=1812271808&click_id=63224_caa131d1-44ce-11ef-894b-844a229bc158&zpbid=63224_caa131d1-44ce-11ef-894b-844a229bc158

Benefits of UTMs:

  • Tracking campaign effectiveness, effectiveness of advertising spend and improving user experience

  • Drawbacks of UTMs; Hard to manage and needs steep learning to put them effectively which result in miss-implementation.

  • Other forms of tracking also possible like referal codes, coupons and analytics.