Skip to content

Instantly share code, notes, and snippets.

View dantejauregui's full-sized avatar

Dante J. dantejauregui

View GitHub Profile
@dantejauregui
dantejauregui / gist:6fdc4a09ccfa60261038e4aa51dae425
Last active May 20, 2017 23:29
creacion de un Container para mi "tensorflow image"
INICIANDO TENSORFLOW DENTRO DE DOCKER
1ra alterinativa> si quiero solo abrir un container "efimero" uso --rm, haciendo uso de volumenes para grabar mantener mis libros jupyter:
sudo docker run --rm -it -p 8888:8888 -v /home/dante/Documents/tensorFlow:/notebooks/huequito tensorflow/tensorflow:1.1.0-rc2-py3
---------------------
2da alternativa> si quiero instalar dependencias de una imagen q inicialize, hare uso de BASH para que me aparezca la linea de comandas e instale lo q necesite.
Primero hago RUN:
sudo docker run --rm -it -p 8888:8888 -v /home/dante/Documents/tensorFlow:/notebooks/huequito tensorflow/tensorflow:1.1.0-rc2-py3
@dantejauregui
dantejauregui / rNativeSumButton1.js
Last active May 14, 2017 22:15
reactNative1 created by dantejauregui - https://repl.it/HxUR/4
import React from 'react';
import { StyleSheet, Text, View, Button, TextInput } from 'react-native';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
numero: 0,
boxNumber: 0
@dantejauregui
dantejauregui / el-comercio.ipynb
Created May 15, 2017 20:53 — forked from Wesitos/el-comercio.ipynb
Ejemplo de scraping usando aiohttp y BeautifulSoup
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Flask Serving
This file is a sample flask app that can be used to test your model with an API.
This app does the following:
- Handles uploads and looks for an image file send as "file" parameter
- Stores the image at ./images dir
- Invokes ffwd_to_img function from evaluate.py with this image
- Returns the output file generated at /output
Additional configuration:
- You can also choose the checkpoint file name to use as a request parameter
- Parameter name: checkpoint
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
texto: '',
saludo: '',
cambio: ''
};
INMUTABLE alternative:
array.concat crea un nuevo array, pero adiciona nuevos elementos en el nuevo array
array.slice crea copia de un array,
object.assign crea copia de obj en el q pueda modificar o agregar elementos en el nuevo objeto
en ES6 salio la nueva alternativa SPREAD OPERATOR que afecta tanto a arrays como objects, q hace lo mismo
con esto podria usar "shouldComponentUpdate" para mi JSX!!
https://developmentarc.gitbooks.io/react-indepth/content/life_cycle/update/using_should_component_update.html
//Ya no usaremos "pyenv", tampoco "pyenv-virtualenv" para crear versiones de Python, porque es mala practica
//en cambio usaremos solo la libreria "virtualenv": https://virtualenv.pypa.io/en/stable/
//en la que por cada proyecto se tendra una version especifica de python
Por ej:
paa el proyecto "Gitchain" se inicia el virtualenv con: source .env/bin/activate
y para cerrar el virtualenv se usa: deactivate
@dantejauregui
dantejauregui / gist:ac6197f5f538e9357b27f45093eab7d0
Last active December 31, 2018 12:49
Virtualenv use for Python v3
desde ahora usaremos solo virtualenv, (nunca mas pyenv)
1. brew install python3 (will install latest python and pip3 versions)
2. pip3 install virtualenv
//siguiendo este tutorial:
//https://help.dreamhost.com/hc/en-us/articles/115000695551-Installing-and-using-Python-s-virtualenv-using-Python-3
3. revisas que versiones de python tienes instaladas en tu pc con:
"python" + TAB
@dantejauregui
dantejauregui / gist:559968381ec85fc9040409473465b8da
Last active January 1, 2019 18:16
Keras with Tensorflow Backend
Followed this: https://www.pyimagesearch.com/2016/11/14/installing-keras-with-tensorflow-backend/
(lo hice para Python2.7)
1.Create a virtualEnv and open it
2. Once is inside, in the console, write this command: export TF_BINARY_URL= (look in Tensorflow WEB the URL: https://www.tensorflow.org/install/pip y buscar sección "Package Location" y "macOS (CPU-only)" )
I used for my MAC: "export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py2-none-any.whl
3. pip install --upgrade $TF_BINARY_URL
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats