Jump to content

ENSS

Membros
  • Contagem de Conteúdo

    5
  • Ingressou

  • Última visita

Informações Pessoais

  • Cidade
    Pinheiral
  • Estado
    Rio de Janeiro (RJ)

Clientes & Parceiros

  • Você é um cliente TecnoSpeed?
    Não
  • Você é um parceiro da Casa do Desenvolvedor?
    Não

Visitantes Recentes do Perfil

O bloco de visitantes recentes está desativado e não está sendo mostrado a outros usuários.

Conquistas de ENSS

0

Reputação na Comunidade

  1. Bom dia amigos! Estou implementando um modelo para realizar o download das fotos do Instagram. Mas além dos downloads das fotos o modelo "baixa" também outros arquivos, como *.json. Poderiam ajudar? Gostaria de fazer o download apenas das fotos. E outra dúvida como faço para limitar o número de fotos baixadas? Segue o código. # importing packages from the library import instaloader # username profile_name = input('Digite o nome do perfil do Instagram: ') print('Download Media...') # configuring instaloader parameters instaloader.Instaloader(download_pictures=True, download_videos=False, download_video_thumbnails=False, compress_json=False, download_geotags=False, post_metadata_txt_pattern=None, max_connection_attempts=0, download_comments=False).download_profile(profile_name) print("Download Completed!") Obrigado
  2. ENSS

    face_recognition

    Pessoal, boa tarde! Estou com esta programação para reconhecimento facial. Possuo duas pastas: A primeira pasta (Images) com as fotos dos atores * Nicolas_Cage * Robert_Downey_Jr A segunda pasta (face_enc) o código deveria crias as duas pastas dos atores com a respectiva codificação. Ao executar o código não é gerado erro. Porém, nada é executado. O algoritmo deveria criar as pastas dos atores com as respectivas codificação respectivas fotos. Segue abaixo o código implementado. Alguém poderia ajudar? #Importing the necessary packages from imutils import paths import face_recognition import pickle import cv2 import os #get paths of each file in folder named Imagens #Images here contains my data (folders of various persons) print("[INFO] quantifying faces...") imagePaths = list(paths.list_images('images')) # initialize the list of knwon encodings and knwon names knownEncodings = [] knownNames = [] #loop over the images paths for (i, imagePath) in enumerate(imagePaths): #for (i, imagePath) in enumerate(imagePaths): #extract the person name from the image path print('[INFO] processing image {}/{}'.format(i + 1, len(imagePaths))) name = imagePath.split(os.path.sep)[-2] print(imagePaths[i]) #load the input image and convert it from BGR (OpenCV ordering) to dlib ordenig (RGB) image = cv2.imread(imagePath) rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) #Use face_recognition to locate faces boxes = face_recognition.face_locations(rgb, model='hog') #compute the facial embedding for the face encodings = face_recognition.face_encodings(rgb, boxes) #loop over the encodings for encoding in encodings: # add each encoding + name to our set of known names and encodings knownEncodings.append(encoding) knownNames.append(name) #save encodings along with their names in dictionary data print("[INFO] serializing encodings...") data = {'encodings': knownEncodings, 'names': knownEncodings, 'name':knownNames} #use pickle to save into a file for later use f = open('face_enc', 'wb') f.write(pickle.dumps(data)) f.close()
  3. ENSS

    Novato

    Thanael, obrigado por responder o post. Mas consegui descobrir. Eu gerei uma list com os anos de 1990 - 2021. O fato, não sei porque o dataframe não carregava os anos 1992 a 2002. No inicio eu estava gerando esta condição gasolina_df=gasolina_df.loc[gasolina_df['MUNICÍPIO']=='VOLTA REDONDA'] após mudar o filtro para gasolina_df=gasolina_df.loc[gasolina_df['CÓDIGO IBGE']==3306305] Consegui carregar todos os dados para o dataframe. Agora, eu gostaria que o total mostrado no gráfico Waffle (GASOLINA / ETANO/DIESEL) fossem em porcentagem.. Poderia ajudar. #instantiate a new figure object fig = plt.figure() #use matshow to display the waffle chart colormap = plt.cm.coolwarm plt.matshow(waffle_chart, cmap=colormap) plt.colorbar() #get the axis ax=plt.gca() #set minor ticks ax.set_xticks(np.arange(-.5, (width), 1), minor=True) ax.set_yticks(np.arange(-.5, (height), 1), minor=True) #add gridlines based on minor ticks ax.grid(which='minor', color='w', linestyle='-', linewidth=2) plt.xticks([]) plt.yticks([]) #compute cumulative sum of individual categories to match color schemes between chart and legend values_cumsum = np.cumsum(tged_df['TOTAL']) total_values = values_cumsum[len(values_cumsum) - 1] #Create legend legend_handles = [] for i, category in enumerate (tged_df.index.values): label_str = category + '(' + str(tged_df['TOTAL'][i]) + ')' color_val = colormap(float(values_cumsum[i])/total_values) legend_handles.append(mpatches.Patch(color=color_val, label=label_str)) #Add legend to chart plt.legend(handles=legend_handles, loc='lower center', ncol = len(tged_df.index.values), bbox_to_anchor=(0., -0.2, 0.95, .1) ) plt.show()
  4. ENSS

    Novato

    Amigos, boa tarde! Estou iniciando na programação Python. E estou encontrando este erro: not_found = list(ensure_index(key)[missing_mask.nonzero()[0]].unique()) KeyError: "None of [Index(['1990', '1991', '1992', '1993', '1994', '1995', '1996', '1997', '1998',\n '1999', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007',\n '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015', '2016',\n '2017', '2018', '2019', '2020', '2021'],\n dtype='object')] are in the [columns]" Meu dataframe df_tot Ao tentar executar este código para gerar um gráfico de regressão #YEARS which we will use for plotting later years = list(map(str, range(1990, 2022))) #Using the sum() method to get the total fuel per year df_tot = pd.DataFrame(df_comb[years].sum(axis=0)) df_tot.head() #change the years to type float (useful for regression later on) df_tot.index = map(float, df_tot.index) #reset the index to put in back in as a column in the df_tot dataframe df_tot.reset_index(inplace=True) #rename columns df_tot.columns = ['year', 'TOTAL'] #view the final dataframe df_tot.head() Obrigado!
×
×
  • Create New...