Tools
Записки программиста, обо всем и ни о чем. Но, наверное, больше профессионального.
2014-08-05
Getting Lots of Data and Artificial Data
Posted by
Valentin
at
11:30
0
comments
2014-08-04
Machine Learning Example Application
В отличие от распознавалки текста в документах, разпознавать текст на фотографиях окружающего мира значительно сложнее.
Имея классификатор (нейросеть), обученный отличать пешеходов от всего остального, мы можем подавать ему на вход куски (patch) интересующей нас картинки, получая ответ — пешеход или нет.
Фишка в том, как готовить эти патчи — техника скользящего окна. Для начала надо выбрать некий исходный размер этого окна и перемещать его по всей картинке, чтобы пошагово в рамку/окно попали все детали изображения. Потом размер окна увеличивается и цикл повторяется. И так столько раз, сколько надо, чтобы покрыть все возможные варианты фигур пешеходов на картинке.
Posted by
Valentin
at
11:30
0
comments
2014-08-01
Large-Scale Machine Learning & Example
Posted by
Valentin
at
11:30
0
comments
2014-07-31
Large-Scale Machine Learning & Example
Posted by
Valentin
at
11:30
0
comments
2014-07-30
Open Source vs Proprietary
Posted by
Valentin
at
11:30
0
comments
Labels: opensource
2014-07-29
webcamfixer
Posted by
Valentin
at
11:30
0
comments
Labels: python
2014-07-28
Import VirtualBox machine
<StorageControllers>
<StorageController name="IDE Controller" type="PIIX3" PortCount="2" useHostIOCache="true">
<AttachedDevice type="HardDisk" port="0" device="0">
<Image uuid="{c8c7052e-926c-4419-93ac-46756167604f}"/>
</AttachedDevice>
<AttachedDevice type="HardDisk" port="0" device="1">
<Image uuid="{c8c7052e-926c-4419-93ac-46756167604f}"/>
</AttachedDevice>
<AttachedDevice passthrough="false" type="DVD" port="1" device="0"/>
</StorageController>
<StorageController name="Floppy Controller" type="I82078" PortCount="1" useHostIOCache="true">
<AttachedDevice type="Floppy" port="0" device="0"/>
</StorageController>
</StorageControllers>
|
<DiskSection>
<Info>List of the virtual disks used in the package</Info>
<Disk ovf:capacity="10737418240" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" vbox:uuid="2d8c0bbc-ed2a-424a-9cfa-e8e922eb42ac"/>
<Disk ovf:capacity="107374182400" ovf:diskId="vmdisk2" ovf:fileRef="file2" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" vbox:uuid="c8c7052e-926c-4419-93ac-46756167604f"/>
</DiskSection>
|
<StorageControllers>
<StorageController name="IDE Controller" type="PIIX3" PortCount="2" useHostIOCache="true">
<AttachedDevice type="HardDisk" port="0" device="0">
<Image uuid="{c8c7052e-926c-4419-93ac-46756167604f}"/>
</AttachedDevice>
<AttachedDevice type="HardDisk" port="0" device="1">
<Image uuid="{2d8c0bbc-ed2a-424a-9cfa-e8e922eb42ac}"/>
</AttachedDevice>
<AttachedDevice passthrough="false" type="DVD" port="1" device="0"/>
</StorageController>
<StorageController name="Floppy Controller" type="I82078" PortCount="1" useHostIOCache="true">
<AttachedDevice type="Floppy" port="0" device="0"/>
</StorageController>
</StorageControllers>
|
Posted by
Valentin
at
11:30
0
comments
2014-07-25
NLP
Posted by
Valentin
at
11:30
3
comments
2014-07-24
Duck Jibe
Posted by
Valentin
at
11:30
3
comments
Labels: video, windsurfing
2014-07-23
2.5 тонны
Posted by
Valentin
at
11:30
0
comments
2014-07-22
fb2tools
Posted by
Valentin
at
11:30
0
comments
Labels: python
2014-07-21
10 распространенных ошибок
>>> def foo(bar=[]): # bar is optional and defaults to [] if not specified
... bar.append("baz") # but this line could be problematic, as we'll see...
... return bar
>>> class A(object): ... x = 1 ... >>> class B(A): ... pass ... >>> class C(A): ... pass ... >>> print A.x, B.x, C.x 1 1 1 >>> B.x = 2 >>> print A.x, B.x, C.x 1 2 1 >>> A.x = 3 >>> print A.x, B.x, C.x 3 2 3
>>> try: ... l = ["a", "b"] ... int(l[2]) ... except ValueError, IndexError: # To catch both exceptions, right? ... pass ... Traceback (most recent call last): File "<stdin>", line 3, in <module> IndexError: list index out of range
>>> try: ... l = ["a", "b"] ... int(l[2]) ... except (ValueError, IndexError) as e: ... pass
>>> x = 10 >>> def foo(): ... x += 1 ... print x ... >>> foo() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 2, in foo UnboundLocalError: local variable 'x' referenced before assignment
>>> numbers = [n for n in range(10)]
>>> for i in range(len(numbers)):
... if odd(numbers[i]):
... del numbers[i] # BAD: Deleting item from a list while iterating over it
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
IndexError: list index out of range
>>> def create_multipliers(): ... return [lambda x : i * x for i in range(5)] >>> for multiplier in create_multipliers(): ... print multiplier(2) ... You might expect the following output: 0 2 4 6 8 But you actually get: 8 8 8 8 8
# In a.py:
import b
def f():
return b.x
print f()
# And in b.py:
import a
x = 1
def g():
print a.f()
import sys
def bar(i):
if i == 1:
raise KeyError(1)
if i == 2:
raise ValueError(2)
def bad():
e = None
try:
bar(int(sys.argv[1]))
except KeyError as e:
print('key error')
except ValueError as e:
print('value error')
print(e)
bad()
UnboundLocalError: local variable 'e' referenced before assignment
import foo
class Bar(object):
...
def __del__(self):
foo.cleanup(self.myhandle)
Posted by
Valentin
at
11:30
0
comments
2014-07-18
The Onion Movie 2008
Posted by
Valentin
at
11:30
0
comments














































