init.py's function is to change the folder into a Python package. in the package of each library in Python, there is init.py file. when we import a package, we actually import its init.py file.In this way, we can batch import the modules we need in init.py files, instead of importing one by one. # package.py 里面的代码 # __init__.py import re import urllib import sys import os
You often see statements like this in OpenStack os.path.normpath(os.path.join(os.path.abspath(sys.argv), os.pardir,os.pardir)) 其中 sys.argv represents the first parameter, for example, server.py in python server.py is the value represented by sys.argv os.path.join is to connect the paths. os.pardir means to retire a directory import os import sys print os.path.normpath(os.path.join(os.path.abspath(sys.argv), os.pardir,os.pardir)) print os.path.abspath(sys.argv)output is C:\Users\s00279560 C:\Users\s00279560\Documents\server.py
sys.argv in python (parameters, unpacking, variables) What you learned here is the method of passing variables to scripts
If you want to run a my.py script in python, you only need to run python my.py on the command line. The my.py part of this command is the so-called' argument)'. What you need to do now is how to write a script that can accept parameters.
from sys import argv script , first , second , third = argv print('the script is called ',script) print('your first variable is ',first) print('your second variable is ',second) print('your thrid variable is ',thrid) import the import library in the first line.
if len(sys.argv) != 5 or (len(sys.argv)==5 and (not (str(sys.argv).strip() == 'entrust' )):
print 'python createHistoryEntrust.py entrust|deal env_no, enturst_no, client_id'
elif str(sys.argv).strip() == 'entrust':
createHistoryEntrust(sys.argv, sys.argv, sys.argv)
elif str(sys.argv).strip() == 'deal':
createHistoryDeal(sys.argv, sys.argv, sys.argv)
Will it be a bit dull to see the above code?????
don't worry, sys.argv is to get a list of command line parameters, such as pythoncreatehistorytrust.py.
Deal 10086 true 0 this command, sys.
1. This article introduces Title: A Review of Studies on Convolutional Neural NetworkAuthor: Li Yandong, Hao Zongbo, Lei HangAuthor: School of Information and Software Engineering, University of Electronic Science and TechnologyPublished in: Computer Applications, September 10, 2016
2. Main Contents 1, CNN's History 1.In the 1960s, when the theory was put forward, Neocognitron took the lead (put forward in 1980)2.around 1998, LeNet-5 dominated the model implementation phase.3. From 2012 till now, AlexNet, VGG, GoogLeNet, ResNet,
Multiple Instance Learning
I have been preparing for the seminar today. It is a report that my tutor specifically asked me to do. It is a paper on "weakly supervised Discriminatory Location and Classification: A Joint Learning Process".After reading it for the first time, I felt that the so-called weakly supervised seems to be just another way of saying it.Before looking at more papers, this conclusion has yet to be verified.
1. Data Set Preparation and Training Data is organized by folders, one for each class.Most other PyTorch tutorials and examples expect you to organize folders by training set and validation set, then organize folders by category in training set and validation set.However, I think this is very troublesome. A certain number of images must be selected from each category and moved from the training set folder to the validation set
Weakly Supervised Object Localization with Multi-fold Multiple Instance Learning Weak Supervised Object Localization Based on Multi-layer and Multi-instance Learning Abstract-In the fields of computation and vision, the classification and location of objects is a challenging problem.Standard supervision training requires bounding box labeling of object instances.Weak supervised learning avoids this time-consuming labeling process.In this case, the monitoring information is limited to two-state labeling, which can indicate whether the object instance in the picture is present or missing.