XML Operations/random operation/size end encountered pits

Source: Internet
Author: User
Xml

1.xml.etree.elementtree.parse is very time-consuming.
You should avoid repeating parse the same file in your code, and put it in memory to swap time in space.

2. XML node assignment operations and copy.deepcopy are not the same
If the new node is assigned directly to a node using the equal sign, the operation on the new node also affects the original node. However, the current node is not affected if you manipulate the new nodes after Copy.deepcopy. Np.random.normal

We usually use this function of numpy to produce Gaussian random numbers, but this function is time-consuming, for the generation of a 4000*3000*3 matrix, the time will be 1s, the alternative method for the temporary unknown size-end problem

The size end refers primarily to the order in which the bytes are stored. High byte at high, low byte in position is small end, vice versa. The small end facilitates the transformation and so on, the big Terminal facilitates the judgment positive and negative. OpenCV while reading the video, with the FFmpeg, in ffmpeg video YUV converted to RGB, in addition to directly using the coefficient matrix, but also to do optimization, including the horizontal direction of the size change, in this step the size of the data storage is different, the direct impact is the color mismatch.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.