analitics

Pages

Showing posts with label notebook. Show all posts
Showing posts with label notebook. Show all posts

Thursday, January 11, 2024

News : NVIDIA Kaolin library provides a PyTorch API.

NVIDIA Kaolin library provides a PyTorch API for working with a variety of 3D representations and includes a growing collection of GPU-optimized operations such as modular differentiable rendering, fast conversions between representations, data loading, 3D checkpoints, differentiable camera API, differentiable lighting with spherical harmonics and spherical gaussians, powerful quadtree acceleration structure called Structured Point Clouds, interactive 3D visualizer for jupyter notebooks, convenient batched mesh container and more ... from GitHub repo - kaolin.
See this example from NVIDIA:
NVIDIA Kaolin library has introduced the SurfaceMesh class to make it easier to track attributes such as faces, vertices, normals, face_normals, and others associated with surface meshes.

Friday, May 5, 2023

Python 3.8.10 : My colab tutorials and news from colab - part 033.

Colab comes with new changes:
Starting today paid users can select their preferred NVIDIA GPU. Visit Runtime > Change runtime type and choose between T4, V100, and A100. We'll do our best to assign your choice based on GPU availability.
Today I tested a new python package called News API with colab to search for news.
News API is a simple, easy-to-use REST API that returns JSON search results for current and historic news articles published by over 80,000 worldwide sources.
You can find my sample code in my collaboration area of the GitHub repository.

Saturday, April 29, 2023

Python 3.8.10 : My colab tutorials - part 032.

I haven't written for the python community in a long time, here is another example that I created using a tool from google called colab.
catafest_038.ipynb - simple example with StableDiffusionPipeline and DiffusionPipeline to generate images based a text ...
This and the other examples can be found in my repository named colab_google on my GitHub account.

Saturday, February 25, 2023

Python 3.8.10 : My colab tutorials - part 031.

I update my source code for the collaboratory google tool. This colab notebook comes with source code for an update of IPython, PyTikTokAPI python module using the cookies browser, and a simple OpenCV test to create an image and show with google.colab.patches.
The cookies for the TikTok package module can be found in any browser by pressing the F12 key.
I don't find a good python package that parse the tiktok content.
The application for development with TikTok looks like Instagram and Facebook ... you can test it at https://developers.tiktok.com/app/.

Sunday, February 19, 2023

Tuesday, January 24, 2023

Python 3.8.10 : My colab tutorials - part 029.

Colab from google is a great tool when you want to write equations. I show a simple example with LaTeX formula with this colab notebook named catafest_034.

Saturday, December 24, 2022

Python 3.8.16 : My colab tutorials - part 028.

Today I added a new example to my GitHub repo on colab with a simple example of how to search for images using Google's custom search A.P.I. You can find this example on my Github webpage example.

Monday, November 7, 2022

Python 3.7.13 : My colab tutorials - part 027.

Today, I update my GitHub repo with python source code tested on colab google.
You can see this notebook named catafest_032.ipynb on my GitHub repo.

Saturday, July 16, 2022

Python 3.7.13 : My colab tutorials - part 026.

Vosk is an offline open source speech recognition toolkit. It enables speech recognition for 20+ languages and dialects - English, Indian English, German, French, Spanish, Portuguese, Chinese, Russian, Turkish, Vietnamese, Italian, Dutch, Catalan, Arabic, Greek, Farsi, Filipino, Ukrainian, Kazakh, Swedish, Japanese, Esperanto, Hindi, Czech, Polish. More to come.
Today I tested this Python package with a video that contains sound content in the Chinese language
I created a simple interface where you can test other videos on youtube and where you can select the language and start time and duration for the detection sequence with the python vosk package.
I used the python youtube_dl package to take portions of wav sound from a youtube video.
I haven't done tests on other videos but it should work.
You can find it on this colab notebook.

Tuesday, July 12, 2022

Python 3.7.13 : My colab tutorials - part 025.

Today I tested a simple data processing example with the first image from NASA's James Webb Space Telescope
You can find this example and more on my GitHub repository for colab.
This is one of results of data processing with a simple logaritm function to see magnitude spectrum of Fourier transform X by shifting the zero-frequency map:

Wednesday, June 1, 2022

Python 3.7.13 : My colab tutorials - part 024.

In this colab notebook I test how to install pytorch and torchvision python packages on colab notebook and save the model to Google drive.
I tried to save the model.ptl file but I got a network error and uploaded the file to googe drive and then downloaded it.
You can see the full source code on this GitHub repo.

Saturday, February 26, 2022

Python 3.7.12 : My colab tutorials - part 023.

NVIDIA announces TensorRT 8.2 and Integrations with PyTorch and TensorFlow on Dec 02, 2021.
This Torch-TensorRT is a high-performance deep learning inference optimizer and runtime that delivers low latency, high-throughput inference for AI applications. TensorRT is used across several industries including healthcare, automotive, manufacturing, internet/telecom services, financial services, and energy.
I tested today using my gavatar image on colab notebook with the GPU device.
Am prelucrat un cod sursa exemplu existent de pe internet cu o un model RESNET known as Deep Residual Learning for Image Recognition, see this website.
model = models.resnet50(pretrained=True).to("cuda")
I have a pretty good picture of the processing possibilities given for this topic and I can tell you today that this implementation of TensorRT is below my expectations.
However, there are some positive elements that can be used with this in the future.
The full exaemple and how can be used TensorRT with colab tool can be found on my GitHub repo with all colabs notebooks.

Sunday, December 26, 2021

Python 3.7.11 : My colab tutorials - part 022.

Here is another notebook with two python scripts.
You may be wondering why I add them here and the index of 022 blog posts does not match the 026 index of those on the GitHub website.
The answer is simple: here I post them when I have time for evaluation and there they are added when they are created and tested.
The posts here are for a share of those who want to learn simple python programming to solve common issues by anyone with minimal school knowledge and for supporting the python programming community.
In this notebook you will find a script that uses a python packet that does a simple search using Google and one that does an image search.

Wednesday, November 17, 2021

Python 3.7.11 : My colab tutorials - part 021.

This is a simple notebook tutorial about how can test and get info from GPU on colab online tool.
This tutorial can be found on my GitHub account.

Tuesday, November 16, 2021

Python 3.7.11 : My colab tutorials - part 020.

The tutorial I created is a test and use of the Selenium WebDriver python package for to automate web browser interaction from Python.
This tutorial can be found on my GitHub account.

Saturday, October 30, 2021

Python 3.7.11 : My colab tutorials - part 019.

The tutorial I created is a test and use Probabilistic Graphical Models for the most basic problem the coin problem with the pgmpy python module.
This tutorial can be found on my GitHub account.

Saturday, September 18, 2021

Python 3.7.11 : My colab tutorials - part 018.

In this colab tutorial, you can see how to use the webcam with python and javascript.
This colab notebook can be found on my colab project on the GitHub webpage.
  • catafest_001.ipynb - first step, import TensorFlow;
  • catafest_002.ipynb - testing the GPU , Linux commands and python modules torch and fastai;
  • catafest_003.ipynb - testing the Altair;
  • catafest_004.ipynb - testing the cirq python package for quantum computing;
  • catafest_005.ipynb - using the estimator on tensoflow 2.0;
  • python_imdb_001.ipynb - using the colab with python module imdbpy;
  • catafest_006.ipynb - google authentification and google.colab drive and files
  • catafest_007.ipynb - test with https://github.com/harrism/numba_examples/blob/master/mandelbrot_numba.ipynb
  • catafest_008.ipynb - few simple examples with selenium and chromium-chromedriver;
  • catafest_009.ipynb - show you how to use %% colab features;
  • catafest_010.ipynb - example with Detectron2 is Facebook AI Research's with state-of-the-art object detection algorithms;
  • catafest_011.ipynb - test a sound classification with YAMNet from a web example - not very happy with the result;
  • catafest_012.ipynb - a simple tutorial about Colab tool and HTML and JavaScript with examples;
  • catafest_013.ipynb - a simple tutorial with settings for TPU and IMDB dataset;
  • catafest_014.ipynb - get IMDB review dataset and show it;
  • catafest_015.ipynb - how to get, show and use it data and create a new train data set from IMDB dataset;
  • catafest_016.ipynb - show the shape of the Fashion-MNIST dataset;
  • catafest_017.ipynb - this example show you how to write another python script in colab and run it;
  • catafest_018.ipynb - PIFuHD demo;
  • catafest_019.ipynb - get title from tiles.virtualearth.net;
  • catafest_020.ipynb - get video from youtube with pytube, converting to audio, show signal wave, energy and frequency;
  • catafest_021.ipynb - BERT is a transformers model with example and sentiment-analysis;
  • catafest_022.ipynb - webcam on colab with python and javascript;

Saturday, September 11, 2021

Python 3.7.11 : My colab tutorials - part 017.

BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding, see this https://arxiv.org/abs/1810.04805.
See this colab notebook with examples at my GitHub account.

Thursday, September 2, 2021

Python 3.7.11 : My colab tutorials - part 016.

This new colab notebook comes with: get youtube videos with pytube, converting to audio, show signals, energy and frequency.
You can see this work on the GitHub account.

Saturday, August 28, 2021

Python 3.7.11 : My colab tutorials - part 015.

Google Maps explicitly forbid using map tiles offline or caching them, but I think Microsoft Bing Maps don't say anything explicitly against it, and I guess you are not planning to use your program commercially (?)
This colab notebook show you how to get a title from tiles.virtualearth.net.
The source code is simple:
class TileServer(object):
    def __init__(self):
        self.imagedict = {}
        self.mydict = {}
        self.layers = 'ROADMAP'
        self.path = './'
        self.urlTemplate = 'http://ecn.t{4}.tiles.virtualearth.net/tiles/{3}{5}?g=0'
        self.layerdict = {'SATELLITE': 'a', 'HYBRID': 'h', 'ROADMAP': 'r'}

    def tiletoquadkey(self, xi, yi, z, layers):
        quadKey = ''
        for i in range(z, 0, -1):
            digit = 0
            mask = 1 << (i - 1)
            if(xi & mask) != 0:
                digit += 1
            if(yi & mask) != 0:
                digit += 2
            quadKey += str(digit)
        return quadKey

    def loadimage(self, fullname, tilekey):
        im = Image.open(fullname)
        self.imagedict[tilekey] = im
        return self.imagedict[tilekey]

    def tile_as_image(self, xi, yi, zoom):
        tilekey = (xi, yi, zoom)
        result = None
        try:
            result = self.imagedict[tilekey]
            print(result)
        except:
            print(self.layers)
            filename = '{}_{}_{}_{}.jpg'.format(zoom, xi, yi, self.layerdict[self.layers])
            print("filename is " + filename)
            fullname = self.path + filename
            try:
                result = self.loadimage(fullname, tilekey)
            except:
                server = random.choice(range(1,4))
                quadkey = self.tiletoquadkey(*tilekey)
                print (quadkey)
                url = self.urlTemplate.format(xi, yi, zoom, self.layerdict[self.layers], server, quadkey)
                print ("Downloading tile %s to local cache." % filename)
                urllib.request.urlretrieve(url, fullname)
                #urllib.urlretrieve(url, fullname)
                result = self.loadimage(fullname, tilekey)
        return result