domingo, 9 de febrero de 2025

guia rapida para instalar tensorflow en windows 11 para utilizarlo con VScode

la siguiente guía es para instalar tensorflow de manera nativa en una computadora con windows 11.

De los links referencias se puede resumir todo en el siguiente grafico:


Tensorflow

https://www.tensorflow.org/?hl=en

Driver actualizado de la tarjeta grafica Nvidia Geforce

https://www.nvidia.com/es-es/drivers/

CUDA

https://developer.nvidia.com/cuda-toolkit

cuDNN

https://developer.nvidia.com/cudnn


Código para ver si funciona Tensorflow utilizando GPU.

import tensorflow as tf # type: ignore

print("num. de GPUs disponibles = ", len(tf.config.experimental.list_physical_devices('GPU')))


if tf.config.list_physical_devices('GPU'):

    gpu_details = tf.config.experimental.get_device_details(tf.config.list_physical_devices('GPU')[0])

    print("Nombre de la GPU:", gpu_details.get('device_name', 'Desconocido'))

 



domingo, 10 de noviembre de 2024

C++ de arduino sobre Notepad

 esto ayuda a que se pueda tener los mismos estilos (aprox.) que arduino IDE pero en notepad++



git clone https://github.com/FLL-e/Notepadpp-Arduino.git

copiar los archivos XML de la carpeta que se descargo


y pegarlos a la carpeta de lenguajes definidos por usuario, esta carpeta se lo puede abrir desde Notepad++


Finalmente debería de quedar algo así:


reiniciar NOTEPAD++ y a disfrutar de lenguaje C++ estilo arduino sobre este editor


jueves, 25 de julio de 2024

Python + OPENCV + Arduino/ESP


Comando para crear un ambiente virtual, instalar requerimientos para trabajar con jupyter notebook, ademas de la libreria Pyserial para controlar con rs232 una placa Arduino o ESP32


comandos en orden:


conda info --env

conda update --all --yes

conda create -n OPENCV python=3.9


conda activate OPENCV

python --version

conda install anaconda::jupyter

si no se ejecuta, antes de instalar  jupyter hacer correr este comando: conda config --set channel_priority flexible

conda install conda-forge::opencv

conda install anaconda::pyserial

conda update pip

si no se ejecuta, antes del conda update pip ejecutar este comando: conda config --add channels conda-forge  

pip install cvzone

pip install mediapipe

pip install controller




viernes, 5 de julio de 2024

Kali Linux sobre Windows utilizando Docker

Estos pasos los realizo, talvez se pueden reducir a mucho menos pasos, pero así me ¡funciona! utilizando un dockerfile.

1- En un sistema Windows descargar e instalar Docker desktop



2- una vez abierto el docker desktop, Pull a la imagen Kalilinux/kali-rolling que es la que recomiendo utilizar

3- Verificamos si ya tenemos la imagen Kalilinux/kali-rolling en PowerShell de windows 

4- entramos a kali linux

 docker run -it kalilinux/kali-rolling

5- ejecutamos los siguientes comandos

apt update

apt full-upgrade -y

apt autoremove -y


5- damos build al archivo dockerfile colocando un nombre de la imagen  nueva (yo le llame mikaliwin), y a esperar que descargue (mucho tiempo, vi una película con todo lo que tardo), descarga aproximadamente 4Gb.


6- momento de utilizar Kali con docker en windows

 docker run -it --network=host mikaliwin bash


Adicional: si por ejemplo nos olvidamos la instalación de un programa, una vez dentro del Kali, en linea Bash por ejemplo pudiéramos instalar:

apt install net-tools

lunes, 1 de abril de 2024

RF-nano



para controlar un robot

Emisor TX

#include <SPI.h>
#include "Mirf.h"
#include "nRF24L01.h"
#include "MirfHardwareSpiDriver.h"
Nrf24l Mirf = Nrf24l(10, 9);
int value;
int contador=0;
int MOV=1;

void setup()
{
  Serial.begin(9600);
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  //Set your own address (sender address) using 5 characters
  Mirf.setRADDR((byte *)"CONTR");
  Mirf.payload = sizeof(value);
  Mirf.channel = 90;              //Set the channel used
  Mirf.config();
}

void loop()
{
  Mirf.setTADDR((byte *)"ROB01");         //Set the receiver address
  value = MOV;                                //adelante MOV=1
  Mirf.send((byte *)&value);                //Send instructions, send random number value
  while (Mirf.isSending()) delay(1);        //Until you send successfully, exit the loop
  delay(200);
  contador=contador+1;
  if(contador>=50){
    MOV=2;
  }
  if(contador>=100){
    MOV=1;
    contador=0;
  }
}

Receptor RX

//Receiver program
#include <SPI.h>
#include "Mirf.h"
#include "nRF24L01.h"
#include "MirfHardwareSpiDriver.h"
Nrf24l Mirf = Nrf24l(10, 9);

int value;
int mov;
//MOTOR 1
const int mot1_A=6; 
const int mot1_B=5;
//MOTOR 2
const int mot2_A=4;
const int mot2_B=3;
//MOTOR 3
const int mot3_A=14;   //A0
const int mot3_B=15;   //A1
//MOTOR 4
const int mot4_A=16;   //A2
const int mot4_B=17;   //A3

void setup()
{
  Serial.begin(9600);
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();

  Mirf.setRADDR((byte *)"ROB01"); //Set your own address (receiver address) using 5 characters
  Mirf.payload = sizeof(value);
  Mirf.channel = 90;             //Set the used channel
  Mirf.config();
  Serial.println("Listening...");  //Start listening to received data

  pinMode(mot1_A, OUTPUT);
  pinMode(mot1_B, OUTPUT);
  pinMode(mot2_A, OUTPUT);
  pinMode(mot2_B, OUTPUT);
  pinMode(mot3_A, OUTPUT);
  pinMode(mot3_B, OUTPUT);
  pinMode(mot4_A, OUTPUT);
  pinMode(mot4_B, OUTPUT);
}

void loop()
{
  if (Mirf.dataReady()) { //When the program is received, the received data is output from the serial port
    Mirf.getData((byte *) &value);
    mov=value;
    Serial.println(mov);
    switch (mov) {
    case 1:
      adelante();
      break;
    case 2:
      atras();
      break;
    case 3:
      izquierda();
      break;
    case 4:
      derecha();
      break;
    case 5:
      detenido();
      break;
    default:
      // if nothing else matches, do the default
      // default is optional
      break;
    }
  }
}

void adelante() {
  digitalWrite(mot1_A, HIGH);
  digitalWrite(mot1_B, LOW);
  digitalWrite(mot2_A, HIGH);
  digitalWrite(mot2_B, LOW);
  digitalWrite(mot3_A, HIGH);
  digitalWrite(mot3_B, LOW);
  digitalWrite(mot4_A, HIGH);
  digitalWrite(mot4_B, LOW);
  }
void atras() {
  digitalWrite(mot1_A, LOW);
  digitalWrite(mot1_B, HIGH);
  digitalWrite(mot2_A, LOW);
  digitalWrite(mot2_B, HIGH);
  digitalWrite(mot3_A, LOW);
  digitalWrite(mot3_B, HIGH);
  digitalWrite(mot4_A, LOW);
  digitalWrite(mot4_B, HIGH);
  }
void izquierda() {
  //motor 1 y 3 adelante
  digitalWrite(mot1_A, HIGH);
  digitalWrite(mot1_B, LOW);
  digitalWrite(mot3_A, HIGH);
  digitalWrite(mot3_B, LOW);
  //motor 2 y 4 atras
  digitalWrite(mot2_A, LOW);
  digitalWrite(mot2_B, HIGH);
  digitalWrite(mot4_A, LOW);
  digitalWrite(mot4_B, HIGH);
  }
void derecha() {
  //motor 1 y 3 atras
  digitalWrite(mot1_A, LOW);
  digitalWrite(mot1_B, HIGH);
  digitalWrite(mot3_A, LOW);
  digitalWrite(mot3_B, HIGH);
  //motor 2 y 4 adelante
  digitalWrite(mot2_A, HIGH);
  digitalWrite(mot2_B, LOW);
  digitalWrite(mot4_A, HIGH);
  digitalWrite(mot4_B, LOW);
  }
void detenido() {
  digitalWrite(mot1_A, LOW);
  digitalWrite(mot1_B, LOW);
  digitalWrite(mot2_A, LOW);
  digitalWrite(mot2_B, LOW);
  digitalWrite(mot3_A, LOW);
  digitalWrite(mot3_B, LOW);
  digitalWrite(mot4_A, LOW);
  digitalWrite(mot4_B, LOW);
  }

Robot

ffdsa fdsa fds  dfdafds

miércoles, 21 de febrero de 2024

todo de docker rapido


Instalar

https://www.youtube.com/watch?v=ZO4KWQfUBBc


BUSCAR imagen

en cmd buscar contenedores

o en por web en docker hub   https://hub.docker.com/

DESCARGAR imagen en este caso Ubuntu, solo el comando: 

docker pull ubuntu



BUILD a una imagen ya descargada con docker, creando de esta manera el contenedor

docker run -it ubuntu:latest /bin/bash


es necesario actualizar dependencias para no tener errores en el contenedor docker ubuntu

apt-get update

apt-get upgrade 


instalando algunos programas útiles

apt-get install net-tools

apt-get install -y build-essential

apt-get install -y software-properties-common

add-apt-repository ppa:deadsnakes/ppa

apt-get update

apt-get install python3

 apt-get install python3-pip

ln -s /usr/bin/python3 /usr/bin/python


salir del contenedor ya coriendo bash

exit


VOLVER a entrar al contenedor del cual salimos que esta en suspension, con la misma sesion


comandos


docker ps -a

docker start 4bca06dc3530

docker exec -it gracious_stonebraker bash


OJO

tener en cuenta que descargar imagen no es tener el contenedor. Al ejecutar RUN creamos el contenedor para ver contenedores ACTIVOS:

docker ps

para ver todos los contenedores ACTIVOS e INACTIVOS: 

docker ps -a

para detener un CONTENEDOR activo:

docker stop 3db75215661 (id del contenedor activo)

para  arrancar un CONTENEDOR detenido:

docker start 3db75215661 (id del contenedor inactivo)


docker sobre linux ver rapidamente este video https://www.youtube.com/watch?v=_0EYw9PGMnM 



domingo, 28 de enero de 2024

cursos recomendados

 

courses & resources

topicformatdifficultyrelease yearpricecourse
Generative AIGitHub repository🟩⬜⬜2023freeGenerative AI for Beginners by Microsoft
Deep LearningYouTube playlist🟩🟩⬜2023free6.5940 TinyML and Efficient Deep Learning Computing by Massachusetts Institute of Technology
Natural Language ProcessingYouTube playlist🟩🟩⬜2023freeNatural Language Processing by The University of Texas at Austin
Deep Learningwebsite🟩⬜⬜2023freeDeep Learning Fundamentals - Learning Deep Learning Using a Modern Open-Source Stack by Sebastian Raschka
Large Language ModelsYouTube playlist🟩🟩⬜2023freeLLM Bootcamp - Spring 2023 by The Full Stack
PythonYouTube playlist🟩⬜⬜2023freeCS50: Introduction to Programming with Python by Harvard University x freeCodeCamp.org
Stable Diffusion and Deep Learningwebsite🟩🟩⬜2023freePractical Deep Learning for Coders part 2: Deep Learning Foundations to Stable Diffusion by fast.ai
Deep LearningYouTube playlist🟩⬜⬜2023free6.S191: Introduction to Deep Learning by Massachusetts Institute of Technology
Deep LearningYouTube playlist🟩⬜⬜2023freeNeural Networks: Zero to Hero by Andrej Karpathy
Large Language Models and Prompt Engineeringwebsite🟩⬜⬜2023freePrompt Engineering Guide by DAIR.AI
Computer VisionYouTube playlist🟩⬜⬜2023freeComputer Vision in Practice by Piotr Skalski x Roboflow
Natural Language ProcessingYouTube playlist🟩🟩⬜2023freeCS685: Advanced Natural Language Processing by University of Massachusetts
Machine LearningYouTube playlist🟩🟩⬜2022freeCS229: Machine Learning by Stanford University
MLOpsYouTube playlist🟩🟩⬜2022freeMachine Learning Engineering for Production by Andrew Y. Ng
Multimodal Machine LearningYouTube playlist🟩🟩🟩2022free11-777: Multimodal Machine Learning by Carnegie Mellon University
Deep Multi-Task and Meta LearningYouTube playlist🟩🟩🟩2022freeCS330 Deep Multi-Task and Meta Learning by Stanford University
Deep LearningYouTube playlist🟩⬜⬜2022freePractical Deep Learning for Coders by fast.ai
Natural Language ProcessingYouTube playlist🟩🟩⬜2021freeCS224U: Natural Language Understanding by Stanford University
TransformersYouTube playlist🟩🟩🟩2021freeCS25: Transformers United by Stanford University
Deep LearningYouTube playlist🟩🟩⬜2021freeNYU-DLSP21: NYU Deep Learning Spring by New York University
Natural Language Processing and Transformerswebsite🟩⬜⬜2021freeNLP Course by Hugging Face
Deep Learningbook🟩⬜⬜2021freeDive into Deep Learning by d2l.ai
Reinforcement LearningYouTube playlist🟩🟩🟩2021freeReinforcement Learning Course by DeepMind x University College London
Natural Language ProcessingYouTube playlist🟩🟩⬜2021freeCS224N: Natural Language Processing with Deep Learning by Stanford University
Deep LearningYouTube playlist🟩🟩⬜2020freeDeep Learning Lecture Series by DeepMind x University College London
Linear Algebrawebsite🟩🟩🟩2019freeAdvanced Linear Algebra - Foundations to Frontiers by Margaret E. Myers & Robert A. van de Geijn
Artificial IntelligenceYoutube playlist🟩🟩⬜2019freeStanford CS221: Artificial Intelligence: Principles and Techniques by Stanford University
Computer VisionYoutube playlist🟩🟩⬜2019freeUniversity of Michigan EECS 498.008 / 598.008: Deep Learning for Computer Vision by University of Michigan
Computer VisionYouTube playlist🟩🟩⬜2018freeCS231n: Deep Learning for Computer Vision by Stanford University
Statistics and ProbabilityYouTube playlist🟩⬜⬜2013freeStatistics 110: Probability by Harvard University